date month year
how to compare current date with database stored many dates.if any 1 stored date is match with current date print same date.if store date is same month or same year then print expiry date is near..please help if know.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sukesh MarlaPosted Sep 9, 2012, 8:23 AM
Example
Select getdAte()
Use DatePart to extract month and year
example
select DAtePart(mm,getDate())
Use Case statement as
Select case when a=1 and b=1 then cast(DateStoredInDatabase as varchar) else
'exp date' end from MyTable
Check this is correct answer if it helped.