Link to home
Start Free TrialLog in
Avatar of engineroom
engineroom

asked on

MS Sql Help, comparing dates

Hey all, i'm trying to compare a date that is in a field in the database to todays date.

So if dateField=getdate() then...  how do i do this?

if 2/5/2008=2/5/2008 then....

Is there anyway that i can also make it conditional? If there is no match for today, then do a anything < today? thanx all
Avatar of ee_rlee
ee_rlee
Flag of Philippines image

CASE WHEN datefield=getdate() THEN ...
          WHEN datefield>getdate() THEN ...
          ELSE ...
END
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of engineroom
engineroom

ASKER

I'll give that a try guys. Just so you know, the

urDateColum is already in a datefield, don't know if that makes a difference or not... does it?