Donate

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.
  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

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

Invalid nested tag div found, expected closing tag input