Sunday, March 25, 2012

Date paramter default value

Hello all,
I have written a report that I would like to be sent to a person or
persons at the beginning of the week. There are two parameters in the
report that the users would normally type the dates. I know I can to the
previous week thing by using a stored procedure, but I would like to
know how I can, at report design time, give those parameters a default
date. I would like to try and use a non-queried value expression like:
=CDATE(dateadd("dd",-7,NOW())) for the start date and
=CDATE(dateadd("dd",-2,NOW())) for the end date
Would this be a valid approach?
Thanks,
Jeff JonesJeffrey Jones wrote:
> Hello all,
> I have written a report that I would like to be sent to a person or
> persons at the beginning of the week. There are two parameters in the
> report that the users would normally type the dates. I know I can to the
> previous week thing by using a stored procedure, but I would like to
> know how I can, at report design time, give those parameters a default
> date. I would like to try and use a non-queried value expression like:
> =CDATE(dateadd("dd",-7,NOW())) for the start date and
> =CDATE(dateadd("dd",-2,NOW())) for the end date
> Would this be a valid approach?
> Thanks,
> Jeff Jones
Okay...I was able to get the default thing to work. I used
=CDATE(MONTH(NOW()) & "/" & DatePart("d",DateAdd("d",-1,NOW())) & "/" &
YEAR(NOW())). Now I seem to be having a bit of a time problem on my
reporting server. My time seems to be set to UTC and I need it set to
US-Central time. Can anyone tell me how to do this? The server machine
time is correct, it is just the reporting server's output that is off.
Thanks,
Jeff Jones|||Take a look at the function ToLocalTime to convert from UTC. If the regional
settings (timezone) set on your reportserver differs from desired output
format you may have to specify timezone params in code.
=MyUTCDateTime.ToLocalTime()
"Jeffrey Jones" wrote:
> Jeffrey Jones wrote:
> > Hello all,
> > I have written a report that I would like to be sent to a person or
> > persons at the beginning of the week. There are two parameters in the
> > report that the users would normally type the dates. I know I can to the
> > previous week thing by using a stored procedure, but I would like to
> > know how I can, at report design time, give those parameters a default
> > date. I would like to try and use a non-queried value expression like:
> > =CDATE(dateadd("dd",-7,NOW())) for the start date and
> > =CDATE(dateadd("dd",-2,NOW())) for the end date
> > Would this be a valid approach?
> > Thanks,
> > Jeff Jones
> Okay...I was able to get the default thing to work. I used
> =CDATE(MONTH(NOW()) & "/" & DatePart("d",DateAdd("d",-1,NOW())) & "/" &
> YEAR(NOW())). Now I seem to be having a bit of a time problem on my
> reporting server. My time seems to be set to UTC and I need it set to
> US-Central time. Can anyone tell me how to do this? The server machine
> time is correct, it is just the reporting server's output that is off.
> Thanks,
> Jeff Jones
>|||I'm new in Reporting Services. Could you please tell me how to use the
ToLocalTime Method within Reporting Services.
Thanks
"Frederik" wrote:
> Take a look at the function ToLocalTime to convert from UTC. If the regional
> settings (timezone) set on your reportserver differs from desired output
> format you may have to specify timezone params in code.
> =MyUTCDateTime.ToLocalTime()
> "Jeffrey Jones" wrote:
> > Jeffrey Jones wrote:
> > > Hello all,
> > > I have written a report that I would like to be sent to a person or
> > > persons at the beginning of the week. There are two parameters in the
> > > report that the users would normally type the dates. I know I can to the
> > > previous week thing by using a stored procedure, but I would like to
> > > know how I can, at report design time, give those parameters a default
> > > date. I would like to try and use a non-queried value expression like:
> > > =CDATE(dateadd("dd",-7,NOW())) for the start date and
> > > =CDATE(dateadd("dd",-2,NOW())) for the end date
> > > Would this be a valid approach?
> > > Thanks,
> > > Jeff Jones
> > Okay...I was able to get the default thing to work. I used
> > =CDATE(MONTH(NOW()) & "/" & DatePart("d",DateAdd("d",-1,NOW())) & "/" &
> > YEAR(NOW())). Now I seem to be having a bit of a time problem on my
> > reporting server. My time seems to be set to UTC and I need it set to
> > US-Central time. Can anyone tell me how to do this? The server machine
> > time is correct, it is just the reporting server's output that is off.
> > Thanks,
> > Jeff Jones
> >

No comments:

Post a Comment