Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Checking dates

Author  Topic 

helixpoint
Constraint Violating Yak Guru

291 Posts

Posted - 2014-12-09 : 13:31:29
I have a date that I am sending the Sproc...reqDate

ealaer in this sproc. I do a select to get the original reqDate

If the dates are the same, I do nothing

If they are different, I have to check that the lesser value of: Getdate() + 60 days or Required Date + 60 days

If it is less, I have to throw an error

I am not sure the best way to do this

Dave
Helixpoint Web Development
http://www.helixpoint.com

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-12-09 : 13:33:54
You can use RAISERROR to throw a message back to the application.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

helixpoint
Constraint Violating Yak Guru

291 Posts

Posted - 2014-12-09 : 14:02:15
Ya. I know how to do the error

quote:
Originally posted by tkizer

You can use RAISERROR to throw a message back to the application.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/



Dave
Helixpoint Web Development
http://www.helixpoint.com
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-12-09 : 14:05:30
Show us some sample data then. Are you storing the reqDate in a variable?

quote:

If it is less



If what is less? "Required Date + 60 days"?

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -