Custom date format problem

  • I am relatively new to SSRS but I am having problems with something that ought to be relatively easy. I have a date/time field that I want to display in MM-DD-YY format (i.e. with the dashes instead of slashes). I put the field onto my report and did properties for the text control, set the format to date and custom and entered mm-dd-yy but when I display the report, the month number comes up as zeroes for all the records. In other words, Christmas would be 00-25-09. I tried using an expression like =FormatDateTime(Fields!MyDate.Value,"mm-dd-yy") but that didn't work either. The only thing I got to work was concatenating the separate date parts with dashes in between. That can't be the solution! I'm sure someone out there has this answer off the top of their heads...?

    Thanks in advance!

  • Try this:

    =format(Fields!YourDate.Value, "MM - dd - yy")

    Eli

  • Thanks very much. I thought I had tried that, but I must have tried with FormatDateTime function instead of Format. It worked fine.

  • Sure - no problem. I think that the reason you may have been receiving 00 is because you had lower case mm which relates to minutes instead of months. If you place MM-dd-yy into the format property you should receive your desired result as well.

    Eli

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply