Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
chriskhan2000
Aged Yak Warrior
544 Posts |
Posted - 2005-10-25 : 12:26:40
|
Is there a way to set a parameter date so that it is always begining of year and another to end of year?I have 2 date parameter that I want it to be like 1/1/2005 - 12/31/2005, then have it automatically change each year. So the next year it'll be like 1/1/2006 - 12/31/2006. |
|
chriskhan2000
Aged Yak Warrior
544 Posts |
Posted - 2005-10-25 : 12:50:22
|
I think this might probably work but have not try it yet.="1/1/" & FORMAT(Globals!ExecutionTime, "yyyy")="12/31/" & FORMAT(Globals!ExecutionTime, "yyyy") Beginning and ending date will always be the same, except for the year which changes depending on when the report was executed. Will let you all know if this works or not. |
 |
|
jhermiz
3564 Posts |
Posted - 2005-10-25 : 17:47:29
|
quote: Originally posted by chriskhan2000 I think this might probably work but have not try it yet.="1/1/" & FORMAT(Globals!ExecutionTime, "yyyy")="12/31/" & FORMAT(Globals!ExecutionTime, "yyyy") Beginning and ending date will always be the same, except for the year which changes depending on when the report was executed. Will let you all know if this works or not.
Chris,You may also do this...=Format(Now(), "yyyy")This will automatically change for each year.."yyyy" will display 2005 or whatever"yy" will display 01, 02, 03...10....NHope this helps,Jon Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]Imperfection living for perfection -- [url]http://jhermiz.blogspot.com/[/url] |
 |
|
chriskhan2000
Aged Yak Warrior
544 Posts |
Posted - 2005-10-26 : 09:43:25
|
Thanks Jon. Yeah the example I thought of does work. It will always put the beginning date of the year and the ending date of the year. Your example also works. Thanks. |
 |
|
|
|
|
|
|