VTFatcat1973
asked on
Format String to Date SSRS 2005
I need assistance on the code below:
=Switch
(
Fields!Well_Child_Visit_Ad olescent.V alue = 9999,"N/A",
Fields!Well_Child_Visit_Ad olescent.V alue = 0000,CStr("12/31/2010"),
Fields!Well_Child_Visit_Ad olescent.V alue = 0001,DateAdd("D",730,Field s!Birthdat e.Value),
Fields!Well_Child_Visit_Ad olescent.V alue = 0002,"Past Due",
Fields!Well_Child_Visit_Ad olescent.V alue,Field s!Well_Chi ld_Visit_A dolescent. Value
)
The last item in the switch returns the data in a string for example(20100625) to represent the date as it should. I need the end-user to see the string formatted as the following : 06/25/2010. I need the syntax to accomplish this is Reporting Services in the Switch Function. Please Help!!! I am beating my head against the wall ;-)
=Switch
(
Fields!Well_Child_Visit_Ad
Fields!Well_Child_Visit_Ad
Fields!Well_Child_Visit_Ad
Fields!Well_Child_Visit_Ad
Fields!Well_Child_Visit_Ad
)
The last item in the switch returns the data in a string for example(20100625) to represent the date as it should. I need the end-user to see the string formatted as the following : 06/25/2010. I need the syntax to accomplish this is Reporting Services in the Switch Function. Please Help!!! I am beating my head against the wall ;-)
ASKER
It does not like that ;-( I get the following error cannot convert string to date type. I believe that I am going to have to use left, right functions, I am just not sure how to do it ;-)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank-you so much- I had to modify it just a bit- but it works great. here is my final code
=Switch
(
Fields!Well_Child_Visit_Ad olescent.V alue = 9999,"N/A",
Fields!Well_Child_Visit_Ad olescent.V alue = 0000,CStr("12/31/2010"),
Fields!Well_Child_Visit_Ad olescent.V alue = 0001,DateAdd("D",730,Field s!Birthdat e.Value),
Fields!Well_Child_Visit_Ad olescent.V alue = 0002,"Past Due",
Fields!Well_Child_Visit_Ad olescent.V alue,Forma t( Left( Fields!Well_Child_Visit_Ad olescent.V alue , 4 ) & "/" &
Mid( Fields!Well_Child_Visit_Ad olescent.V alue , 5, 2 ) & "/" &
Right( Fields!Well_Child_Visit_Ad olescent.V alue , 2 ) )
)
=Switch
(
Fields!Well_Child_Visit_Ad
Fields!Well_Child_Visit_Ad
Fields!Well_Child_Visit_Ad
Fields!Well_Child_Visit_Ad
Fields!Well_Child_Visit_Ad
Mid( Fields!Well_Child_Visit_Ad
Right( Fields!Well_Child_Visit_Ad
)
ASKER
Awesome ;-)
format(Cdate(Fields!Well_C
), "MMMMMMMM dd, yyyy")