Groups | Blog | Home
all groups > sql server reporting services > march 2005 >

sql server reporting services : string to date


collie
3/20/2005 12:37:03 AM
Hi,

I have a varchar field in my database. I want to convert that field to date
mm/dd/yyyy.
Sometimes the values in the fields contain 8 characters such as 31122005 and
sometimes 7 such as 3/12/2005.

How can I convert the fields in rss?

Mary Bray [MVP]
3/21/2005 9:58:07 AM
I don't think anything is going to recognise 31122005 - what if it comes as
1122005? Is that the 11th of Feb or the 1st of Dec? If this were me I'd be
changing the database field to a proper date field and trying to convert the
crappy data you are obviously stuck with.
Other wise you may be able to build some monstrous iif expression that looks
for the "/" character and trys to extract days and months - it would be
pretty hideous.
--

Mary Bray [SQL Server MVP]
Please reply only to newsgroups

[quoted text, click to view]

AddThis Social Bookmark Button