depending on your mysql version: for the date/time field version:
select * from foobar where yourdatefield < DATE_ADD( CURDATE( ) , INTERVAL -7 DAY ) i don't use unix timestamps, but you may check the UNIXTIME() and UNIX_TIMESTAMP() functions for converting them before using the DATE_ADD(). lars On 2/11/07, barz040 <[EMAIL PROTECTED]> wrote:
Hi all I want to extract the records that aren't oldest of 1 week. Ho can I do this in two mode? 1) when my data field is int(10) and I store record with unix time (1171152000) 2) when my data field is a data field and I store record with format 2007-02-11 12:50:02 Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- Lars Schwarz Gottorpstrasse 20 26122 Oldenburg T 0441 2171 354 0 F 0441 2171 354 0 M 0179 512 4628 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]