Saturday, February 25, 2012

Previous Business Day

At the moment, I have a report that's using "=Today.AddDays(-1)" to return
yesterday's date in the date range parameters, but the client has now come
back and requested that they would prefer not to use weekends...e.g.: loading
the report on Monday should show last Friday's date.
Can this be done?
Thanks in advance.
Jadranka Krapic
DBA
Stargate Technologies
(www.stargatetech.com.au)Hi,
Write simple custom code function
Function GetDate() As Date
Select Case Today.DayOfWeek
Case DayOfWeek.Monday
GetDate = Today.Date.AddDays(-3)
Case Else
GetDate = Today.Date.AddDays(-1)
End Select
End Function
And as parameter label and value put
=Code.GetDate()
Hope this help.
Best regards,
Dejan Lukovic
"Jadranka" <Jadranka@.discussions.microsoft.com> escribió en el mensaje
news:03C3F8BF-1EC8-420B-81D9-106D94D608A1@.microsoft.com...
> At the moment, I have a report that's using "=Today.AddDays(-1)" to return
> yesterday's date in the date range parameters, but the client has now come
> back and requested that they would prefer not to use weekends...e.g.:
loading
> the report on Monday should show last Friday's date.
> Can this be done?
> Thanks in advance.
> Jadranka Krapic
> DBA
> Stargate Technologies
> (www.stargatetech.com.au)

No comments:

Post a Comment