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.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Sukesh MarlaRank #461 · 5.4K reputationPosted Sep 9, 2012, 4:23 AM EDT
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.