Friday, March 8, 2013

Find 12 months previous date

Following SQL commands can be used to find the date before 12 months

In Informix,
select * from table where connected_date  < today - (12 UNITS MONTH)

In MySQL,
select * from table where added_date>DATE_ADD(TODAY,INTERVAL -12 MONTH)