Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need to set default value to yesterday date.

1 view
Skip to first unread message

Lam Nguyen

unread,
Aug 23, 2005, 12:35:15 PM8/23/05
to
I create parameter like BeginDt and need to put default values -> Non-queried
something like =((now) - 1) return yesterday but
I am getting errors.


I need to default values to yesterday so when the users open the report he
does have to enter 08/22/2005. If you have some information on
how to do this would greatly appreciate.

Bruce L-C [MVP]

unread,
Aug 23, 2005, 12:58:38 PM8/23/05
to
This is done with dotnet library functions. Here are two expressions that
allow defaults of yesterday from 7 to today at 7

= cdate(DateAdd(DateInterval.Day, -1, Now()).ToShortDateString & " 07:00")

= cdate(Now().ToShortDateString & " 07:00")


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

"Lam Nguyen" <LamN...@discussions.microsoft.com> wrote in message
news:39BB5E96-5D74-455B...@microsoft.com...

Lance

unread,
Aug 23, 2005, 1:02:33 PM8/23/05
to
Try this:

=DateAdd(DateInterval.Day, -1, Now())

alternatively, if you want the date to be 08/22/2005 12:00 AM instead
of 08/22/2005 12:02 PM:

=DateAdd(DateInterval.Day, -1, Today())

Lance Hunt
http://www.lance-hunt.net

0 new messages