Link to home
Start Free TrialLog in
Avatar of clock1
clock1

asked on

How to find and store 4-digits in a string

I have a Table with 2 fields of different data types:  Location (Text), Date (Date).
Currently, the Date field is empty.
Is there a way to populate the Date field with the 4 numbers contained in the Location field and concatenate "1/1/" before 4 numbers.
The 4 numbers always appear adjacent and can be anywhere within the Location field.
See current state (BEFORE) and desired state (AFTER), below.


BEFORE:

ID    Location                                                                                            Date
1      c:\red\white\blue\red1844\green\snack1.doc
2      c:\yellow\green\wheat2015.bmp
3      c:\gr1995een\orange.jpg


AFTER:

ID    Location                                                                                            Date
1      c:\red\white\blue\red1844\green\snack1.doc                           1/1/1844
2      c:\yellow\green\wheat2015.bmp                                                 1/1/2015
3      c:\gr1995een\orange.jpg                                                               1/1/1995
SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of clock1
clock1

ASKER

Thanks for comment, but chose vb script in error.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, Bill.

I have updated the code.
Avatar of clock1

ASKER

Thanks