Convert integer of MYYYY into Date in ssrs

780 views Asked by At

I have a field that is a bunch of integers formatted like so:

92014
102014

I would like to convert the field into a datetime of the first of each month. So the newly formated field would be:

9/01/2014 00:00:00
10/01/2014 00:00:00

(or however datetimes would actually get formatted). Can anyone help?

1

There are 1 answers

0
Mike On BEST ANSWER

This is how you can accomplish this in an expression:

DateTime.ParseExact(IIF(LEN(Trim(Fields!StringDate.Value)) < 6, "0" & Fields!StringDate.Value,Fields!StringDate.Value),"Myyyy",System.Globalization.CultureInfo.InvariantCulture)