Avatar of mishlce
 asked on

date/time format

I want to change coulumns A and B to look like Columns C and D in access 2003.  Pls provide formula.
Microsoft Access

Avatar of undefined
Last Comment
Gustav Brock

8/22/2022 - Mon

I understand from the Excel file that you are getting a date/time field from the SQL end that is formatted as:
    2012-12-17 01:03:23.000
You would prefer the format to be:
    12/17/2012  1:03:00 AM

There are at least a dozen ways to accomplish what you want.  It could be fixed from the SQL end.  It could be imported to Access with a field definition that accounts for the changes.  It could be stored exactly like the SQL source format, or it could be stored as your preferred format.  Either way, it could be displayed, printed, or manipulated using any format you care to think up.  It could even be changed via an Excel macro or shell scripting between getting the data out of SQL and importing it to Access.

There really is no appropriate formula I could provide without more info about how you are getting the info from SQL, how you intend to import it into Access, how you intend to store it in your Access database, and how you want to use the information once it is properly imported into Access.  Are you using Visual Basic for Office, or just the stock realtime database interface that Access provides when you open the database?

More info, please...
Gustav Brock

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Hamed Nasr

FORMAT ([START TIME], "mm/dd/yyyy hh:mm AM/PM")
FORMAT ([END TIME], "mm/dd/yyyy hh:mm AM/PM")

The data is pulled from SQL by IT.  They place that data into an access databaseas a table that I utilize.  They are not going to change it on the SQL end, so I must format it in access to read as:  12/17/2012  1:03:00 AM.  In the access table it is formated as Text.  I have tried to change the formating to date/time but it will not convert.  It erases all.  I am wondering if there is a querie I can run in access to reformat it to date/time as requested.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes

Gustav this worked.
Gustav Brock