MySQL Date Range Query Example
Here is an example to query MySQL Date Range given the date field is of
type TimeStamp. The date_format() will remove the time part in comparing.
type TimeStamp. The date_format() will remove the time part in comparing.
select date_format(date_purchased,'%m/%d/%Y')as dates, url from dbCommerce.tblproducts where date_format(date_purchased,'%m/%d/%Y') between '04/30/2011' and '05/30/2011' order by date_purchased asc;
Comments
Post a Comment