Export serial date to excel as a string

Z

Zameug

I have a access 2007 database that stores all the date fields as a serial
numbers. For instance 26238 is really 11/1/1971. I need to export the
database into excel so I can read it on my mainframe as 1111971. The
mainframe cannot convert 26238 to a date, it just sees it as a number 26,238.
That is why I need the actual value to be 1111971. Can someone please
help. I use an access query and the export wizard to create the exell
spreadsheet. If I had to write a module in access 2007 i would, though I am
not very familiar with the access basic language.
 
D

Douglas J. Steele

You sure you want 111971 as the number? How will you distingush between
1/11/1971 and 11/1/1971?

Looks as though your numeric date is the same as what Access uses
internally: the number of days relative to 30 Dec, 1899. From the Immediate
Window (Ctrl-G):

?Format(26238, "General Date")
1971-11-01
?Format(26238, "mdyyyy")
1111971
?Format(26238, "mmddyyyy")
11011971
 
Z

Zameug

The mainframe program knows it will always be 11 01 1971 because of the
number of digits.

THANK YOU VERY MUCH!! IT WORKED!! Since I am not familiar with all the MS
Basic commands, it was taking me hours of reseach to try to figure this out.
Thanks again.
 
D

Douglas J. Steele

That makes no sense to me at all. HOW will the mainframe program know that
1111971 is 11 01 1971 and not 01 11 1971? Try and see: 25944 corresponds to
11 Jan, 1971.
 
Z

Zameug

I see now why it looks confusing. In my initial post I made a mistake in
explaning what the mainframe would need to see. I wrought 1111971 instead of
what I should of wrote was 11 01 1971. Sorry for the confusion.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top