Link to home
Start Free TrialLog in
Avatar of ryanvb83
ryanvb83Flag for United States of America

asked on

Easy SQL date question

I am writing a select statement and I would like to show a 1 if a date is in the past and 0 if it is today or in the future.  I'll send up summing that field to come up with the number of records that have a date that is in the past.  This is what I have so far.
SELECT DateField, NameField
FROM MasterTable
WHERE NameField = @Variable
GROUP BY NameField

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg 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 ryanvb83

ASKER

That worked.  Thanks!