Dates, Times, and Databases
From: Matt Hughes (hughes.matt_at_gmail.com)
Date: 11/05/04
- Next message: Lothar Kimmeringer: "Re: Dates, Times, and Databases"
- Previous message: Gaurav: "new free java database"
- Next in thread: Lothar Kimmeringer: "Re: Dates, Times, and Databases"
- Reply: Lothar Kimmeringer: "Re: Dates, Times, and Databases"
- Reply: Daniel Dittmar: "Re: Dates, Times, and Databases"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 5 Nov 2004 08:17:54 -0800
I have recently been asked to add a datetime column to my database
schema and support searching on it through a GUI. My problem is that
sometimes people will enter just a date in the column, sometimes a
date with just the hour, and sometimes maybe they'll want to enter all
the datetime information down to the millisecond.
Of course, if someone enters in the search field just a date
'11/04/2004' they want all the rows in that table that match that date
regardless of time. However, if they get more specific, such as
'11/04/2004 2:00' they want all the rows that match that date and time
regardless of the trailing time units (seconds, milliseconds).
However, that is not how databases currently work with datetime in my
experience. If you have a datetime field and the entry is '11/04/2004
2:00 PM' and try to search where field='11/04/2004' it will not match
that entry. Has anyone dealt with this situation and created any sort
of solution. It seems that databases should be much smarter about
this.
- Next message: Lothar Kimmeringer: "Re: Dates, Times, and Databases"
- Previous message: Gaurav: "new free java database"
- Next in thread: Lothar Kimmeringer: "Re: Dates, Times, and Databases"
- Reply: Lothar Kimmeringer: "Re: Dates, Times, and Databases"
- Reply: Daniel Dittmar: "Re: Dates, Times, and Databases"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|