Author |
Topic |
tooba
Posting Yak Master
224 Posts |
Posted - 2012-07-31 : 00:15:15
|
Hi, I have two Date Parameter (Start Date) & (End Date). I want to give a Default Value on (Start Date) & (End Date) (One Month Old Date) i.e (6/30/2012). If user want to use other date they can put and Can i Create Calender Window so user can easily select date. Any Advise? Thank You. |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-07-31 : 08:02:22
|
This expression will give you one month ago today:dateadd("m",-1,Today()) |
|
|
tooba
Posting Yak Master
224 Posts |
Posted - 2012-08-01 : 20:21:46
|
I want something like this. I have two parameter Start Date and End Date. I want to use a default value Previous month. i.e If i try to run this report today default dateshould be Start Date = 7/1/2012 and End Date = 7/31/2012 and if i run this report next month mean in September default date should be Start Date = 8/1/2012 and End Date 8/31/2012. Thanks for Help. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-01 : 21:55:07
|
startdate=DateAdd(DateInterval.Month,DateDiff(DateInterval.Month,#01/01/1900#,Now()),#01/01/1900#)EndDate=DateAdd(DateInterval.Month,DateDiff(DateInterval.Month,#01/01/1900#,Now())+1,#01/01/1900#)------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
tooba
Posting Yak Master
224 Posts |
Posted - 2012-08-01 : 22:14:06
|
Viskh16 Thank you for your reply. I tried your expression and now i am getting value START DATE = 8/1/2012 and END DATE = 9/1/2012. I really appreciate if i can get START DATE = 7/1/2012 and END DATE = 7/31/2012. If i run same report tomorrow i can get same default value START DATE = 7/1/2012 AND END DATE = 7/31/2012. Thanks for your help.... |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-01 : 23:04:26
|
startdate=DateAdd(DateInterval.Month,DateDiff(DateInterval.Month,#01/01/1900#,Now())-1,#01/01/1900#)EndDate=DateAdd(DateInterval.Day,-1,DateAdd(DateInterval.Month,DateDiff(DateInterval.Month,#01/01/1900#,Now()),#01/01/1900#))------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
tooba
Posting Yak Master
224 Posts |
Posted - 2012-08-02 : 00:22:25
|
Awesome... Thank you for your help VISAKH16. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-02 : 10:13:24
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|