Formatting date mm/dd/yyyy to month-yyyy

  • I've passed a date field from s stored proc but I'm trying to format it. i.e. I'm trying to format/convert the value 1/31/2008 in datefield to display as January - 2008, or Jan - 2008, but I just can't figure out what expression/syntax I need to use. I also have two date parameters and I'm trying to include a textbox in the header section which shows the begindate and enddate parms as mmm - yy or mmmmm - yy, but I can't figure that out either.

    I looked up MSDN library but couldn't find the relevant expression/syntax.

    Any help is greatly appreciated.

    John

  • Quite easy!

    Here's how I did it :

    "The " & Day(cdate(Fields!Date_Prep.value )) & " " & MonthName(Month(cdate(Fields!Date_Prep.value)))& " " & Year(cdate(Fields!Date_Prep.value )

    it gives me something like that "The 3 February 2008"

    hope it helps!

  • Hi

    You can use following expression:

    =Format(CDate(Fields!FieldName.Value),"MMM - yyyy")

    or

    =Format(CDate(Fields!FieldName.Value),"MMMM - yyyy")

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

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