• GA_SQL - Friday, September 15, 2017 9:36 AM

    i need solution has SSRS expression
    I tried some like this
    =DateAdd("m", -2, DateSerial(Year(Now()), Month(Now()), 1))

    later i found this parameter type is text  as attached

    Ok, now we're getting somewhere :).

    When you say you want the date, are you actually looking for a date value, or a text value with the value "08-2017"? If you want a date with for the start of the previous month, you'll need to change the datatype of your paramter to date. Then you can use:
    'Today, this would return 2017-08-01
    =Dateadd("M", DateDiff("M", "01/01/2000",Today())-1,"01/01/2000")

    If you want the text format, then you'll want for add a format to it:
    'today this would return "08-2017"
    =Format(Dateadd("M", DateDiff("M", "01/01/2000",Today())-1,"01/01/2000"),"MM-yyyy")

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk