Help with Modules

T

TYE

i have a database that i updata daliy to other database. what i want to do is
change the data in second table

the data format is the following,

03/09/2005 11:30:16

i want to change it to this

20050903113016

so the date is backwards without / this also the date in the same order but
taking out : this
 
J

John Nurick

If these are Access date/time fields, all you need do is change the
format used to display the field in the second table to
yyyymmddhhnnss

If they are text fields, try using this expression in your query,
replacing TheDate with the actual name of the field you want to convert.

Format(CDate([TheDate]), "yyyymmddhhnnss")

This will usually work OK unless the computer has US regional settings,
in which case 03/09/2005 will be read as March 9 and converted to
20050309. To avoid this possibility, you need to parse the day, month
and year out of the string; this can be done with an expression like
this:

Format(DateSerial(Mid([TheDate], 7,4), Mid([TheDate], 4,2),
Left([TheDate], 2)) + CDate(Right([TheDate], 8)), "yyyymmddhhnnss")
 

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