Access - change date from 1968-05-04 00:00:00 UTC to short date

Please offer suggestions on how to change this date format:

1968-05-04 00:00:00 UTC

into a short date format in Access?

Thank you.
exp vgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Try this:
Format(Left("1968-05-04 00:00:00 UTC", 10),"short date")

Open in new window

exp vgAuthor Commented:
This helps - but is there a way to change this format into short date, not just this particular date.

Meaning, the date column will have dates other than 5/4/1968.

Thank you.

Change YourTable to the name of your table and SqlDate to the name of the field containing the date to be converted.

Sub Demo()

    Dim rs As DAO.Recordset
    Set rs = CurrentDb.OpenRecordset("SELECT * FROM YourTable")

    'Check if the recordset contains records
    If Not (rs.EOF And rs.BOF) Then
        Do Until rs.EOF = True
            'Perform an edit
            On Error Resume Next
            rs!SqlDate = Format(Left(rs!SqlDate, 10), "short date")
            'Save the change

            'Move to the next record. Don't forget to do this.
        MsgBox "There are no records in the recordset."
    End If

    MsgBox "Finished converting dates."

    Set rs = Nothing

End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

exp vgAuthor Commented:
Thank you for taking the time in offering this.

Is this possible in a simple query at all?
Do you mean an update query?
exp vgAuthor Commented:
Thank you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.