Posted By

on 01/08/09


Tagged

date


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

brent-man
vali29
dantreacy
kubaitis
virendrakryadav


how to calculate last 7 days...


 / Published in: MySQL
 

URL: http://www.sitepoint.com/forums/showpost.php?p=3602847&postcount=2

if you want to get info from a column within certain date, like the latest 7 days, you should use this, mydatefld is your date column

  1. WHERE mydatefld >= DATE_SUB(CURRENT_DATE, INTERVAL 7 DAY)

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: NeoBlack on January 8, 2009

that's not PHP it's MySQL.

You need to login to post a comment.