Forum Moderators: open

Message Too Old, No Replies

all records less than 7 days old mysql

         

topr8

6:38 pm on Mar 2, 2006 (gmt 0)

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



with sql server this is simple enough (to me)

but with mysql it seems to be harder
i have a column that records the date/time of the insert in the format

clickdate: 2006-03-01 15:03:59

i'm trying to retrieve records only inserted in the last week

SELECT yadda WHERE clickdate>=(CURRENT_DATE()-7)

this doesn't do it,
how do i? gnash gnash

FalseDawn

7:18 pm on Mar 2, 2006 (gmt 0)

10+ Year Member



[dev.mysql.com...]

First example on the page.

topr8

7:23 pm on Mar 2, 2006 (gmt 0)

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



great thanks,

i got to using date_add and trying to add a negative number of days.

date_sub did it