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.
Author |
Topic |
cullyK
Starting Member
5 Posts |
Posted - 2007-02-06 : 12:40:06
|
ok so I am guessing you use the datediff function but not sure how to get the output i actually want.I have a variable @mydate I want to see if it is before or on todays date.Is it something like if not DATEDIFF(day,getDate(),@mydate) > 1 begin --then @mydate is a date before today Endhaving a hard time testing this, thanks |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-06 : 13:12:29
|
if @mydate < getdate()select 'yesterday or before'elseselect 'the future!'if datediff(day, @mydate, getdate())) > 0select 'yesterday or before'elseselect 'the future!'Peter LarssonHelsingborg, Sweden |
|
|
cullyK
Starting Member
5 Posts |
Posted - 2007-02-07 : 04:05:20
|
thank you sir |
|
|
|
|
|