Re: Optimizing date queries

2001-12-05 Thread Emil Rasmussen
>mysql ... which would prevent index usage. If your kind of query is > frequent and slow, you could split your DATETIME column into two > separate columns for DATE and TIME and put an index onto TIME. Ok, thanks for the help! Regards Emil -- Emil Rasmussen http://

Re: Optimizing date queries

2001-12-05 Thread Emil Rasmussen
ing about it, that i did not like. I dont know why, it just seems a strange thing to do, when there is a DATETIME datatype. But i might spilt them into a DATE and a TIME field, that is definitely one solution to the problem. Thanks! Regards Emil -- Emil Rasmussen h

Re: Optimizing date queries

2001-12-05 Thread Emil Rasmussen
ed to strings, before MySQL can search the table. MySQL have to do a complete table scan when i use the HOUR() function. But thanks for the suggestion. Regards Emil -- Emil Rasmussen http://noget.net - Before posting,

Re: Optimizing date queries

2001-12-05 Thread Emil Rasmussen
and days sorted by hours. MMDD should be some kind of a wildcard, so that i only would look at the HHMMSS data. Now i use the HOUR() function, but then MySQL dont uses the index. Regards Emil -- Emil Rasmussen http://noget.net ---

Re: Optimizing date queries

2001-12-05 Thread Emil Rasmussen
EN AND operator does not work either. I would like to know how to format the limits, so that MySQL understands that i want the results from a particular hour? Regards Emil -- Emil Rasmussen http://noget.net - Before posting, p

Re: Optimizing date queries

2001-12-05 Thread Emil Rasmussen
been very nice, because i still have a problem with hours, eg.: SELECT count(id) FROM tblTable WHERE myField != '' AND ( myDateField >= '23' AND myDateField < '235959' ); Wich offcourse does not work, so again i

Re: Optimizing date queries

2001-12-04 Thread Emil Rasmussen
SQL did not use that. But creating an index only on myDateField did the trick. Thanks for the help! Mvh Emil -- Emil Rasmussen http://noget.net - Before posting, please check: http://www.mysql.com/manual.php (the manual) h

Optimizing date queries

2001-12-04 Thread Emil Rasmussen
off course is, that MySQL has to do a calculation on the myDateField before it can decide if the row matches. Any "workarounds" for this? Mvh Emil -- Emil Rasmussen http://noget.net - Before posting, please check: h