Convert YYYYMMDD as a Char(8) to DD/MM/YYYY varchar(10) in SQL 2k

I imported a table in which the date format is YYYYMMDD Char(8) and I need to convert the
date to the DD/MM/YYYY varchar(10) format.  Is there an update statement or something
equivalent to make this conversion painless?  Thanks for your help.
Chuck_aaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ram2098Connect With a Mentor Commented:
sorry..change it to varchar(10)..
select convert(varchar(10),getdate(),103
0
 
ram2098Commented:
select convert(varchar(20),getdate(),103)

this will give you the date in dd/mm/yyyy format.
0
 
FDzjubaCommented:
SELECT CAST((substring(@cDate,7,2)+'/'+substring(@cDate,5,2)+'/'+ substring(@cDate,1,4)) as nvarchar(10))
0
 
ram2098Commented:
Replace getdate() below..to the date in your table...

select convert(varchar(10),yourdatefield,103)
0
 
FDzjubaCommented:
oops, where @cDate is your column name:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.