Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Yesterday data selection - only if business day 1

Status
Not open for further replies.

ddrake

Technical User
Mar 19, 2003
92
Hi all,
I know I've seen this topic in here before, just can't locate the post. I've got a report that chooses a variety of data with a 'Create Date' of yesterday. Of course, this works great Tuesday through Friday! What I need though is something that will select on if yesterday was a business day only so if I run the report on a Monday, it will look at the Friday prior instead of Sunday prior.
I can suck up holidays as inconsequential. Thanks all!!

Dave
 
It was posted earlier today foir a problem addressed by TEM3.

Assuming you run this report Monday through Friday, then modifying the formula.

Code:
//@datex
(
if DayOfWeek(CurrentDate) = 2 then
     {table.date} = CurrentDate - 3
   else
     {table.date} = CurrentDate - 1
)


However, be aware that it may take longer processing the report if this is in your record selection. Click on Database->Show SQL Query and see if the date appears. You may have to do what I have done. Make a copy of the report to run on Mondays only with Currentdate - 3

Cheers,
-LW

Code:
{table.date} = currentdate - 3
 
Perfect! On both solutions. Thanks a lot!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top