Link to home
Start Free TrialLog in
Avatar of PeterErhard
PeterErhard

asked on

Date within mySQL query

Is there a way to within a query to use a date calculation to do the following rather than having to do it with php

select * from table
where DATE >=  '2011-09-17' (todays date)
AND DATE <=  '2011-09-24'  (one week from now)
Avatar of savsoft
savsoft
Flag of India image

just use data type as date for date column then use simple query as mention .. It will work fine
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes but use datatype as date for date column field
Try this:

mysql> select * from table where date_column between  '2011-09-17'and  '2011-09-24';

mysql> Select * from tables where date > "2011-09-17' and CREATE_TIME < "2011-09-24";

Avatar of PeterErhard
PeterErhard

ASKER

Thanks for your help guys, _agx_'s was what I was most looking for.