简体   繁体   中英

Convert date format MM-DD-YY to MM-dd-yyyy in SSRS

How can I convert date format MM-DD-YY to MM-dd-yyyy ?

For example:

CurrentDate is 11-30-15 - (MM-DD-YY)

Expected output is 11-30-2015 - (MM-dd-yyyy)

I want to set Expression to for this date value in format MM-dd-yyyy

I tried below but not worked for me,

=Format(Fields!CurrentDate.Value, "MM-dd-yyyy")

Note: I do not want to convert it into MM-dd-yyyy from Stored Procedure .

As CurrentDate was a string , not a date so I need to convert it to a date first, then formatted it and worked fine now.

=Format(CDate(Fields!CurrentDate.Value), "MM/dd/yyyy")

Thanks you so much for your views.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM