Forum Moderators: open

Message Too Old, No Replies

MySQL

Subtracting Dates to show last week....

         

tonynoriega

8:23 pm on Aug 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I thought this would work after looking at about 10 threads on Subtracting Dates...and the Interval function...but to no avail....

I have the colum "entry_time" as a "datetime" format in my table...

can anyone provide a tip?

SELECT nhm_associate, COUNT(nhm_associate) AS totalcount FROM registration_table GROUP BY nhm_associate WHERE entry_time > DATE_SUB(CURDATE(), INTERVAL 14 DAY)

tim222

8:35 pm on Aug 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's an example from mysql.com:

SELECT something FROM tbl_name WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= date_col;

[dev.mysql.com...]

tonynoriega

8:39 pm on Aug 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



figured it out...

thanks...