I have just begun "playing around" with MySQL and I have a question about indexing on dates.
Part of our system is a work flow management system and we have a table for all documents that we receive. Each document record has several dates to indicate when various processing functions have been completed. In addition to the date we also wish to know the time. In setting up my first table I set the dates up as DATETIME fields. However, indexing on these forces me to specify a date and time or a range. i.e. where ReceivedDate = '2002-07-26 08:15:05' or where ReceivedDate >= '2002-07-26' and ReceivedDate < '2002-07-27' Since most of the queries I would run that would take the date into consideration would be to find every document that was received on a given date am I better off making two fields, one for ReceivedDate and one for ReceivedTime or is there a way to create an index only on the Date portion of a DATETIME field? Thanks for the help. Darrell --------------------------------------------------------------------- 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