A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Seek type:DateTime Problems



 
 
Thread Tools Display Modes
  #1  
Old May 5th, 2009, 12:46 PM posted to microsoft.public.access
David[_42_]
external usenet poster
 
Posts: 21
Default Seek type:DateTime Problems

I'm using a DateTime field type as a PrimaryKey

(even if PrimaryKey was autonumber and an indexed DateTime field type the
problem is the same)

When Seeking a DateTime a .NoMatch condition may arise because the datetime
is actually stored as a double. If the .NoMatch condition is used to
distinquish between .Edit or .Add, a record may be added when edit is
desired. Consequently, multiple records in the DB which appear to have
the same datetime stamp (display only) when in fact they are slightly
different because of the decimal precision.

Anyone have a workaround
OR
whether it is best to store a datetime as a text field (YYYYMMDDHHMMSS
Timezone) in Access?


  #2  
Old May 5th, 2009, 01:00 PM posted to microsoft.public.access
Maarkr
external usenet poster
 
Posts: 240
Default Seek type:DateTime Problems

I've had issues with the precision and I just used the format property when
needed to limit the precision, but I'm not sure that it may help you with
seeking and using datetime as a primary key.

"David" wrote:

I'm using a DateTime field type as a PrimaryKey

(even if PrimaryKey was autonumber and an indexed DateTime field type the
problem is the same)

When Seeking a DateTime a .NoMatch condition may arise because the datetime
is actually stored as a double. If the .NoMatch condition is used to
distinquish between .Edit or .Add, a record may be added when edit is
desired. Consequently, multiple records in the DB which appear to have
the same datetime stamp (display only) when in fact they are slightly
different because of the decimal precision.

Anyone have a workaround
OR
whether it is best to store a datetime as a text field (YYYYMMDDHHMMSS
Timezone) in Access?



  #3  
Old May 5th, 2009, 01:08 PM posted to microsoft.public.access
David[_42_]
external usenet poster
 
Posts: 21
Default Seek type:DateTime Problems

Thanks for response.

I do not believe formatting first will limit the precision on the value of
the actual double that represents the date. Stated differently, how it is
displayed (amount of precision) and what the actual value (double) is, are
different.


"Maarkr" wrote in message
...
I've had issues with the precision and I just used the format property
when
needed to limit the precision, but I'm not sure that it may help you with
seeking and using datetime as a primary key.

"David" wrote:

I'm using a DateTime field type as a PrimaryKey

(even if PrimaryKey was autonumber and an indexed DateTime field type the
problem is the same)

When Seeking a DateTime a .NoMatch condition may arise because the
datetime
is actually stored as a double. If the .NoMatch condition is used to
distinquish between .Edit or .Add, a record may be added when edit is
desired. Consequently, multiple records in the DB which appear to
have
the same datetime stamp (display only) when in fact they are slightly
different because of the decimal precision.

Anyone have a workaround
OR
whether it is best to store a datetime as a text field (YYYYMMDDHHMMSS
Timezone) in Access?





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.