download from as/400

C

CAM

Hello,

I get a download from as/400. There is a particular field call "postdate" ,
which appears as 20080101 - year, month, day how do I convert this in
my query to 01/01/2008 in access 2002?

Cheers
 
R

Rick Brandt

CAM said:
Hello,

I get a download from as/400. There is a particular field call
"postdate" , which appears as 20080101 - year, month, day how do
I convert this in my query to 01/01/2008 in access 2002?

Cheers

=Format(CDate(Format([FieldName],"0000-00-00")),"mm/dd/yyyy")
 
J

John W. Vinson/MVP

Hello,

I get a download from as/400. There is a particular field call "postdate" ,
which appears as 20080101 - year, month, day how do I convert this in
my query to 01/01/2008 in access 2002?

Cheers

Try

CDate(Format([postdate], "@@@@-@@-@@"))
 
T

Tony Toews [MVP]

CAM said:
I get a download from as/400. There is a particular field call "postdate" ,
which appears as 20080101 - year, month, day how do I convert this in
my query to 01/01/2008 in access 2002?

You've got good answers on converting that value to a date field but
note that dates internally within Jet are held as numbers since an
epoch date. Thus to have it appear as either mm/dd/yyyy or dd/mm/yyyy
is a matter of your regional settings or format expression in the text
controls.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Top