Microsoft Access field need to convert to date. 5/17/2018.

I have a field an MSAccess table where I need to strip off the literal part in the field.
The table is called User_Time and the field is called Stat_1.

This is what the data looks like:
5/17/2018 6:07 PM by Smith, Kyle

I need the data to look like:

Then I need to convert the new data to a date time field.
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.

=mid([Stat_1],1,instr(1[Stat_1]," "))
Gustav BrockCIOCommented:
You can create a query like this after you have added new date field to the table:

Update User_Time
Set NewDateField = DateValue(Left(Replace([Stat_1], " ", "  "), 10))

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
David BernsteinChief DeveloperCommented:
Use an update query to

Where NewDateField is a date / time field
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Gustav BrockCIOCommented:
David, did you even try to check that?
Format returns a string, not a date, and - in this case - that would be the full string.
David BernsteinChief DeveloperCommented:
UPDATE tablel SET date2 = Format([date1],"mm/dd/yy");

date1 and date2 are both date fields
Gustav BrockCIOCommented:
I have no idea what you are trying to do, nor why you are posting these.
For your last post to work, it should simply read:

UPDATE tablel SET date2 = [date1]

Open in new window

though this has no relevance to the question.
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.