On 1 Dec 2003 at 16:32, Kevin Carlson wrote:

> select * from DateInfo where DATE_FORMAT(updateDate, '%m/%Y') =
> '03/2003'
> 
> I have an index on the updateDate column but it does not seem to be
> used since I am altering the value with the DATE_FORMAT function in
> the where clause.

How about something like this?

   SELECT * FROM DateInfo WHERE updateDate BETWEEN '2003-03-01' AND
   '2003-03-31';

Or if updateDate is a DATETIME column,

   SELECT * FROM DateInfo WHERE updateDate BETWEEN '2003-03-01
   00:00:00' AND '2003-03-31 23:59:59';

-- 
Keith C. Ivey <[EMAIL PROTECTED]>
Tobacco Documents Online
http://tobaccodocuments.org


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to