Changnig text to date

rowk

Board Regular
Joined
Aug 11, 2002
Messages
72
Hi there. I've got a month ID field with is YYYY"M"MM eg June 05 is 2005M06> When I import this into access it's a text field - how can I convert this to a date format. I know I can do it in excel - but can't seem to work it out.

Any help would be appreciated.

Row
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi Row
Create a new field in the import table (into which you can store the converted date, format it as date), create a new query (an Update Query) based on the imported table, add the new field to the query, and in the 'update to' part of the new field enter this :
DateSerial(Left([date],4),Right([date],2),1)
Please note I based this on a field name called 'date', be sure to use your actual field name (month id per your post?). Save and run the query. You should now have a field in the import table that has the date in the correct format.
HTH, Andrew :)
 
Upvote 0

Forum statistics

Threads
1,221,864
Messages
6,162,497
Members
451,770
Latest member
tsalaki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top