[ale] Searching by dates in MySQL

James Sumners james at sumners.ath.cx
Wed Aug 25 17:42:34 EDT 2004


SELECT col1, DATE(date_col, "%c-%d-%y") as dtime WHERE dtime BETWEEN
'8-18-04' AND '8-25-04';

I believe that should do it.

On Wed, 25 Aug 2004 15:23:54 -0400
Christopher Fowler <cfowler at outpostsentinel.com> wrote:

> 
> I'm using many datetime fields in MySQL and I want to create a report
> that will give me all the records within a date range.
> 
> What is the easiest way to search for all rows that are between 8-18-04 and
> 8-25-04?


-- 
James Sumners
http://ug.dyndns.org/~jsumners/

"All governments suffer a recurring problem: Power attracts pathological
personalities. It is not that power corrupts but that it is magnetic to the
corruptible. Such people have a tendency to become drunk on violence, a
condition to which they are quickly addicted."

Missionaria Protectiva, Text QIV (decto)
CH:D 59



More information about the Ale mailing list