Convert columns from yyyymmdd (text) to dd/mm/yyyy (date)

O

owainT

Hi

At the moment I'm trying to move some data from our company mainframe
to a SQL 2000 database. I've been given a delimited file which I put
into Excel before using DTS to import into sequel. However, all dates
in the CSV are stored as yyyymmdd and as a text format in excel. I've
searched these forums for answers on how to convert these fields to a
dd/mm/yyyy format, but I couldn't get any suggestions to work properly.
(It doesn't really matter if excel changes it to a string of
'dd/mm/yyyy' as opposed to a date field long as it's in that format.

I'd be really grateful for any help.

Cheers

Owain
 
V

Voodoodan

You could try this:

If A1 equals the cell with yyyymmdd then goto cell B1 and enter:

=RIGHT(A1,2)&"/"&MID(A1,5,2)&"/"&LEFT(A1,4)

Dan.
 
J

J.E. McGimpsey

one way:

Select the column. Choose Data/Text to Columns. Click Next,
Next, and select the ymd option from the Date dropdown. Click Finish.

Format the dates as you like.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top