Forum Moderators: open

Message Too Old, No Replies

mysql - how to get 180 days old rows

         

brnco

9:27 pm on Dec 13, 2007 (gmt 0)

10+ Year Member



Hi,

I would like to select all the rows which are exactly 180 days old.

Please could you help me with this?

the cource code looks like that:

select * from info where DATE_SUB(DATE_FORMAT(inserted_date, '%Y%-m-%d') , INTERVAL -180 DAY )=CURRENT_DATE()

Thanks for your help

Demaestro

9:43 pm on Dec 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



select * from info where DATE_SUB(DATE_FORMAT(inserted_date, '%Y%-m-%d')) = (CURRENT_DATE()INTERVAL -180 DAY )

Something like this?

brnco

10:33 pm on Dec 13, 2007 (gmt 0)

10+ Year Member



thanks for your help. it looks my previous post was ok.

brano