Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


About the SSRS Perameter Expression


About the SSRS Perameter Expression

Author
Message
Ravikptel
Ravikptel
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 30
what expression Should i use to get the last month last week range .

for example
if the current month is october
So I want in my date and time perameter
range which shows 09/23/2013 - 09/30/2013


Can Anyone help me with this ?


Thanks
Mark Fitzgerald-331224
Mark Fitzgerald-331224
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3690 Visits: 1513
Could you please clarify the requirement? The example you gave covers 8 days inclusive 23rd to 30th. Do you want the last 8 days, from the last Monday of the month, need more info?

Also are you looking for a SSRS code query or TSQL query?


Fitz
Ravikptel
Ravikptel
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 30
Hi Fitz,

My mistake. I want last month 7 days which is from 24 to 30th. and if the month has 31 days then 25 to 31.
and I want to use that as a parameter in the SSRS code or expression if you can.


thanks
Daniel Bowlin
Daniel Bowlin
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2950 Visits: 2629
For the beginning of your date range use
=DATEADD("d",-7,DATEADD("m",DATEDIFF("m","1900-01-01",Today() ),"1900-01-01"))
For the end of your date range use
=DATEADD("d",-1,DATEADD("m",DATEDIFF("m","1900-01-01",Today() ),"1900-01-01"))

As a bit of an explanation, This will return the first day of the month (at midnight)
DATEADD("m",DATEDIFF("m","1900-01-01",Today() ),"1900-01-01")

Then all you do is add
DATEADD("d",-7, and a closing ) at the end
or
DATEADD("d",-1, and a closing ) at the end
to get the date you want
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search