Hi, Can someone give me ideas on how to structure a query to select results that are over 30 days but less than 60 days old, using the timestamp on the record? I have never played around much with date and time so I am quite clueless as where to begin. Thanks
where unix_timestamp(`datefield`) > (unix_timestamp(CURDATE()) - 60*60*24*30) AND unix_timestamp(`datefield`) < (unix_timestamp(CURDATE()) + 60*60*24*30) This is the easy way... but there are alot of more easy ways Haven't tested it
Thanks, that looks good. When I get a chance to test it I'll tell you how it goes. Edit: Over looking again, it seems that it will select records that are less than 30 days old and not further than 30 days into the future? I may have gone cross eyed