If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Date/Time problem please help !
Hi all,
In one of my tables there is a field defined as date/time. When I add a record for example 07-12-2004 12:15:00 this is ok. but when I add a record with 07-12-2004 00:00:00 it goes wrong. The only thing that after input that is displayed is 07-12-2004. Why doe Acces trows away the time when it is 00:00:00 and can I do something about it ? Please advise, Thanks a lot in advance, Bart Janisse |
#2
|
|||
|
|||
Bart,
A date/time field in Access is in essence a numeric field which is diplayed in a certain format by default. The integer part of the number is the date, 0 being 12/31/1899 (today is 38,337), and the decimal part is the time (1 being 24 hours, 0.5 being 12 hours etc). So, when you enter a date with time 00:00:00, you are essenstially entering an integer numeric value. Then Access doesn't find a time part so it doesn't display one, much like it wouldn't display a decimal part if one wasn't stored in a numeric field with no format imposed. If you want to always display the hour, all you need to do is set the format of the field to: "mm-dd-yyyy hh:nn:ss" HTH, Nikos w wrote: Hi all, In one of my tables there is a field defined as date/time. When I add a record for example 07-12-2004 12:15:00 this is ok. but when I add a record with 07-12-2004 00:00:00 it goes wrong. The only thing that after input that is displayed is 07-12-2004. Why doe Acces trows away the time when it is 00:00:00 and can I do something about it ? Please advise, Thanks a lot in advance, Bart Janisse |
#3
|
|||
|
|||
This may not be relevant, but what "time" is 00:00:00? That seems more like
a "duration" than a "point in time". Jeff Boyce Access MVP w wrote in message . nl... Hi all, In one of my tables there is a field defined as date/time. When I add a record for example 07-12-2004 12:15:00 this is ok. but when I add a record with 07-12-2004 00:00:00 it goes wrong. The only thing that after input that is displayed is 07-12-2004. Why doe Acces trows away the time when it is 00:00:00 and can I do something about it ? Please advise, Thanks a lot in advance, Bart Janisse |
#4
|
|||
|
|||
Hi Jeff,
This may not be relevant, but what "time" is 00:00:00? That seems more like a "duration" than a "point in time". Thanks for your response. This may be a stupid question but how do you specify the time at midnight in a 24 hour format ? I think that after 23:59:59 comes the next day 00:00:00 Bart |
#5
|
|||
|
|||
Access stores the date/time value as a fractional number, where the whole
number represents the date, and the time is the fraction of a day (.5 = noon; .25 = 6am, ...) It is therefore not losing the time - just not displaying it. Just as the number: 22 is exactly the same as: 22.000 so the 07-12-2004 is exactly the same as 07-12-2004 00:00:00 If you want Access to display the time anyway, use the Format property of the field in the table, or the Format property of the text box on your form. Set it to something like this: dd\-mm\-yyyy hh:nn:ss in whatever display format you need. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. w wrote in message . nl... In one of my tables there is a field defined as date/time. When I add a record for example 07-12-2004 12:15:00 this is ok. but when I add a record with 07-12-2004 00:00:00 it goes wrong. The only thing that after input that is displayed is 07-12-2004. Why doe Acces trows away the time when it is 00:00:00 and can I do something about it ? Please advise, Thanks a lot in advance, Bart Janisse |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with Normal.dot or formatting??? | nedkelly2 | General Discussion | 11 | July 2nd, 2007 07:02 PM |
Reinstalling OE... | KAR | Outlook Express | 24 | August 21st, 2004 06:52 PM |
Big Problem. We need the fix | Captain K | Calendar | 0 | July 8th, 2004 04:50 PM |
Fromatting Problem w/ Document Created in Works | Inky | Formatting Long Documents | 2 | May 4th, 2004 04:22 AM |
Word 2000 footnote problem: footnotes consistently too high (again) | Lori | Formatting Long Documents | 2 | May 1st, 2004 07:15 PM |