grippat Posted November 29, 2007 Share Posted November 29, 2007 I want to perform a SELECT on a table and only get rows that have a date of less than 8 months ago. The column that contains the date is in the timestamp format "2007-11-29 12:00:00". How would I do this? Here's the sudo-code: SELECT *FROM exampleWHERE date > 8 months ago Link to comment Share on other sites More sharing options...
justsomeguy Posted November 29, 2007 Share Posted November 29, 2007 Depending on which database you're using, there should be date functions that you can use. Here are the date and time functions for MySQL, the datediff function takes a difference between two dates:http://dev.mysql.com/doc/refman/5.0/en/dat...-functions.html Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.