Is this possible?

sueviolet

Registered User.
Local time
Today, 03:09
Joined
May 31, 2002
Messages
127
I have one field in a table which contains the date in the following format:

mm/dd/yy

The table I need to append this data to, however, structures the date data differently. There are 3 separate fields:

year, month, day

Is there anyways I can import the mm/dd/yy field into the year, month, day fields?

Thanks
 
It can be done OK, but it's probably a bad idea all around. A Date/Time data type is stored as a double-precision, floating-point number (up to 15 decimal places). The integer portion of the double-precision number represents the date. The decimal portion represents the time as a portion of a whole day.

To illustrate, try this from the debug window:

myDte = now()
? myDte
8/27/02 6:21:06 PM

Here's how myDte is stored by Access:
? cDbl(myDte)
37495.7646527778

When you store a date in separate year, month, day
fields, what you're undoubtedly doing is storing them as strings.

To do anything with those strings, you've first got to convert back to a real date. Totally unnecessary work.

Having said that, here's how you might convert each of the components (from the debug window):

? right(year(myDte), 2)
02
? format(month(myDte), "00")
08
? format(day(myDte), "00")
27
 

Users who are viewing this thread

Back
Top Bottom