Access Update Query to Extract Date

I'm trying to use an Access updated query to extract the date from a field in the following formats:
#241 QIC Demo Merged Report Reopening 04-11-2018.xlsx
#003 QIC DEMO Merged Report 04-05-2016 REOPENING LOGS.xlsx
#118 QIC Demo Merged Report_08-18-2016 REOPENING LOGS.xlsx
#039 QIC Demo Merged Report 01.13.2017-Remand(1 of 2 ).xlsx
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

I'm not sure you can do this with a query alone.  I think you will need to create a VBA function.

Since the date isn't in a fixed position or have fixed formatting, pulling it out will be more complicated.  Looking at the first three lines, I would suggest using Split() to pull out all the parts separated by spaces into an array and then looping through the array to find the element that tests positive to IsDate().  However the fourth one is problematic.  Not only is the date not a valid format, it is not surrounded by spaces.  To find that one, I would loop through the string selecting 8 characters at a time.  If the first character of the 8 is numeric, I would then replace dots with dashes and see if the field was a date.

Given that, I would probably just use the second method in all cases so I didn't have to write and test two pieces of code.
shieldscoAuthor Commented:
can you provide spit code
Split() is a function.  

You've been a member of the site for 7 years.  If you don't know how to write VBA, you can use one of the site.s methods that allow you to hire someone to do your work for you.
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

shieldscoAuthor Commented:
Ok let someone else provide comments . I will close and award you 100 points. Thanks
Gustav BrockCIOCommented:
You can use this expression:

TrueDate = CDate(Mid(Replace(Replace([YourField], "Reopening ", ""), ".", "/"), 29, 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
Asking people to write code that you will get paid for is rude.  Our goal here is to help people to help themselves, not to do their work for free.
shieldscoAuthor 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.