HOW TO CONVERT DD-MM-YY to YYYYMMDD IN ACCESS DATABASE?

P

Potchtalon

HI

I have a project where i need to compare two sets of databases and see where
they match up or not. I one of the databases is using DD-MM-YY data standard
format, while the other is using the YYYYMMDD. I need to convert DD-MM-YY
data into the YYYYMMDD string, so that i can link the two databases together.
I have search the net for help, but yet to see how to do that in SQL/ACCESS.

I figured that first i would convert the DD-MM-YY (ex. 09-Jun-06) into
DD/MM/YYYY, and than convert it to YYYMMDD. That’s my theory. Perhaps there
is a simpler way to do this.

I'm a very new to Access/SQL so any help will be appreciated

Thank you

Anton
 
S

Stefan Hoffmann

hi Anton,
I figured that first i would convert the DD-MM-YY (ex. 09-Jun-06) into
DD/MM/YYYY, and than convert it to YYYMMDD. That’s my theory. Perhaps there
is a simpler way to do this.
First of all, check whether the values are stored as Date/Time values.
If so, you can use the Format() function in a query to get any Date/Time
formatting you want.

But your problem sounds, that your values are stored as Text. You may
use CDate() to convert them, but this may fail, if the values uses none
of the "known" Date/Time formats.


mfG
--> stefan <--
 

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