September 15, 2017 at 7:57 am
Need to set default value for a parameter has last month and same year (e.g 08-2017)
Thanks in advance
September 15, 2017 at 8:02 am
GA_SQL - Friday, September 15, 2017 7:57 AMNeed to set default value for a parameter has last month and same year (e.g 08-2017)Thanks in advance
Are you looking for an expression, T-SQL? What have you tried?
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
September 15, 2017 at 8:24 am
In SSRS while setting default value for parameter i am trying to set default value for a parameter has last month and same year (e.g 08-2017)
September 15, 2017 at 8:43 am
GA_SQL - Friday, September 15, 2017 8:24 AMIn SSRS while setting default value for parameter i am trying to set default value for a parameter has last month and same year (e.g 08-2017)
Ok, but that doesn't answer any of my prior questions, that's just a repeat of your requirements. 🙂 See my quoted post below.
Thom A - Friday, September 15, 2017 8:02 AMAre you looking for an expression, T-SQL? What have you tried?
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
September 15, 2017 at 9:18 am
I have one SSRS report, text parameter which is in 09-2017 (drop down of all the months in year) format , for default parameter i need load last month load like 08-2017
September 15, 2017 at 9:24 am
GA_SQL - Friday, September 15, 2017 9:18 AMI have one SSRS report, text parameter which is in 09-2017 (drop down of all the months in year) format , for default parameter i need load last month load like 08-2017
You're just asking the question again, and not answer my questions:
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
September 15, 2017 at 9:30 am
Refer to this attachment
September 15, 2017 at 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
September 15, 2017 at 9:43 am
GA_SQL - Friday, September 15, 2017 9:36 AMi 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
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply