On Wednesday 05 Dec 2001 09:30, Emil Rasmussen wrote:
> > CREADE INDEX myDateField_Index
> > ON tblTabel
> > (
> > DATE_FORMAT(myDateField,'%Y%m%d')
> > );
> >
> > This may or may not work, but it's worth a shot, if you prefer your query
>
> in
>
> > the format it was in before.
>
> It did not work with MySQL 3.23.32, it whould have been very nice, because
> i still have a problem with hours, eg.:
>
> SELECT count(id)
> FROM tblTable
> WHERE myField != '' AND
> (
> myDateField >= '00000000230000' AND
> myDateField < '00000000235959'
> );
>
> Wich offcourse does not work, so again i am looking for some help?

Don't you mean

myDateField >= '20011205230000' AND
myDateField < '20011205235959'
?

You have to include the full format to make it work, i.e. including the 
YYYYMMDD section of the YYYYMMDDHHMMSS format. The above query will probably 
yield no results because you have no data in the given range (year 0000).

Regards.

Gordan

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to