Groups | Blog | Home
all groups > sql server reporting services > december 2004 >

sql server reporting services : Date parameter 7 days in advance


Tango
12/14/2004 12:29:02 PM
can somebody pls help me with the formula for a datetime parameter that is
say 7 days past today. this will be used as the end date parameter.

my start_date parameter default is =(today)

Tango
12/14/2004 12:55:04 PM
Thanks John,

I tried adding this statement in the default value of the query & it didnt
work
I also copied your statement into the query string of a new dataset & get
error message 'minimum capacity must be non negative'

Todd

[quoted text, click to view]
Tango
12/14/2004 1:13:01 PM
undefined function 'getdate' in expression is the error message i get when i
run the query in the new dataset

[quoted text, click to view]
Tango
12/14/2004 2:09:02 PM
Thanks saglamtimur

i am now getting an error message 'doesnt have the expected type'

[quoted text, click to view]
John Geddes
12/14/2004 8:37:54 PM
Try using SQL to create a dataset.

SELECT dateadd(day,7,getdate()) as end_date

I use dateadd like crazy.


[quoted text, click to view]

John Geddes
12/14/2004 8:57:53 PM
Put the statement in a new dataset.

Then, go to the parameter and select default value from dataset, pick
your new dataset, and then pick the column name.

Did that help?


[quoted text, click to view]

saglamtimur
12/14/2004 11:17:48 PM
If you want vb.net solution I use this function for one week (7 days);
=format(dateadd("ww",1,Globals!ExecutionTime),"dd/MM/yyyy")

"ww" equals week, 1 equals 1 week, if you want further info just google
"vb.net dateadd function"

Hope helps.

Regards

[quoted text, click to view]

sathya
12/15/2004 12:13:02 PM
Use expression (for seven days before):
=DateTime.Now.AddDays(-7)
Use expression (for seven days after):
=DateTime.Now.AddDays(7)


[quoted text, click to view]
Tango
12/15/2004 2:13:03 PM
Thank you soooo much sathya

works a charm

[quoted text, click to view]
Ben Sullins
1/5/2005 3:09:04 PM
How could this be done w/ a parameter?

=format(dateadd("mm",-1,parameters!stardate),"MMMM")

Thanks...

[quoted text, click to view]
Tango
1/5/2005 3:19:03 PM
would it be safe to assume that you could insert the starting date parameter
instead of now. so the second date (end date) is x days after the starting
date??

[quoted text, click to view]
Ben Sullins
1/6/2005 10:23:03 AM
Here's the formula...

=CDate(Parameters!startdate.Value).AddMonths(-1).ToString("MMMM")

[quoted text, click to view]
saglamtimur
1/6/2005 11:38:33 AM
Hi Ben,

I have just wrote a solution for your previous post.

saglamtimur

[quoted text, click to view]

AddThis Social Bookmark Button