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:
5/17/2018

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

bfuchsCommented:
=mid([Stat_1],1,instr(1[Stat_1]," "))
0
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

0

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
NewDatefield=Format(Stat_1,"Mm/dd/yyyy")

Where NewDateField is a date / time field
0
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.
0
David BernsteinChief DeveloperCommented:
UPDATE tablel SET date2 = Format([date1],"mm/dd/yy");

date1 and date2 are both date fields
0
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.
0
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.