Connecting Tech Pros Worldwide Forums | Help | Site Map

Help With Datetime_Stamp

Newbie
 
Join Date: Oct 2009
Posts: 1
#1: Oct 20 '09
Hi!

I'm trying to do a query in which I am trying to retrieve any data that is less than 90 days old.

At this time I am hardcoding the date to get the results I need.

Here is the code for the query that I have right now:

select artist, ' - ', title
from tracks
where sold not like 'Y'
and category not like 'X'
and category not like 'A'
and category not like 'B'
and datetime_stamp < '04/01/2009'
order by artist;

Any help is appreciated!

Thanks!

code green's Avatar
Expert
 
Join Date: Mar 2007
Location: England
Posts: 1,079
#2: Oct 21 '09

re: Help With Datetime_Stamp


Expand|Select|Wrap|Line Numbers
  1. datetime_stamp  < DATE_SUB(CURDATE(), INTERVAL 90 DAY)
Is one way.
Be careful of any time element with the date when comparing.
Reply

Tags
datetime_stamp