Question : Date issue on two dates

i have a situation where users are entering in both date fields, sometimes leaving startdate as null or a blank, and adding the date in commencedate.

I am trying to make a query whereby if there is a blank or null on the startdate, then I will automatically pickup the second date, if they have filled that in commencedate.

I have not got this expression right, any ideas I would be grateful

select  
firstname, lastname, code, startdate, commencedate
from my table
where startdate >= GetDate() if null
else commencedate >= GetDate()

Answer : Date issue on two dates

this should do:;
1:
2:
3:
4:
5:
select  
firstname, lastname, code, startdate, commencedate
from my table
where isnull(startdate, commenceDate) >= GetDate() 
Random Solutions  
 
programming4us programming4us