jbalbo
SSCertifiable
Points: 7583
More actions
November 13, 2013 at 4:57 am
#279141
Hi
I need to compare two dates and use one depending on the case
needs to be something like
if table1.expdate is not null then use table1.expdate
else if table2.expdate is null use '2099-12-31' else use table2.expdate end as enddate
Thanks
Joe
Sean Pearce
SSCoach
Points: 15999
November 13, 2013 at 5:01 am
#1666009
SELECT COALESCE(table1.expdate, table2.expdate, '2099-12-31') as enddate
The SQL Guy @ blogspot[/url]
@SeanPearceSQL
About Me[/url]
November 14, 2013 at 12:09 pm
#1666501
Thanks Sean
Works great.. should have known that one 🙁
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply