Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Date Format

Status
Not open for further replies.

AT76

Technical User
Apr 14, 2005
460
US
Hi,

I brought a table from AS400 to access. It brought a particular column as a "NUMBER" data type. The Format of the field is: YYYYMMDD.

Is there a way to change this field (perhaps thru a query to DDMMYYYY and change the data type to "DATE"

Thank you!
 

Hi,

Your YYYYMMDD STRING is not a REAL DATE in MS Access. It must be CONVERTED to a Date Serial Value using the DateSerial Function
Code:
DateSerial(Left([AS400String],4),Mid([AS400String],5,2),Right([AS400String],2))
this value can then be displayed in a number of formats.


Skip,

[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
Poultry in motion to pullet for a paltry amount! [tongue]
 
Thank you!! Works Great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top