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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wednesday only data 1

Status
Not open for further replies.

wld1957

Technical User
Feb 3, 2006
68
US
I need help in having the report automatically select the information based only on each Wednesday for the current week (Monday - Friday). Currently I have a Date parameter that is used to select each Wednesday. It would be easier than selecting a date each time the report is ran.
In the selection criteria I use:
{cpmain.courtdate} = {?SALE DATE}

I have tried dayofweek, crWednesday in a formula but have not been able to get the report to work with this.

Any help would be appreciated. Thanks in advance.
 
Just to clarify:

You want to only see the relevant information for Wednesday of the current week?

If you run the report on Monday the 1st then you want info from Wednesday the 3rd only?

If you run the report on Friday the 5th then you want info from Wednesday the 3rd only?

What happens if you run the report on Saturday or Sunday? Is it again only to pull results from the Wednesday of the current week?

If so try the following:

{cpmain.courtdate} =
if dayofweek(today) = 1 then today-4 else
if dayofweek(today) < 4 then today+(4-dayofweek(today)) else
if dayofweek(today) > 4 then today-(dayofweek(today)-4) else
today

If you base your weeks differently then you must adjust the formula.

There are probably 100 more elegant ways to do this - but you can at least understand the principle behind the above.

'J

CR8.5 / CRXI - Discovering the impossible
 
You should be able to use:

{cpmain.courtdate} = currentdate-dayofweek(currentdate)+4

If you wanted the report to go back to the previous Wednesday if the currentdate was Sunday, then you could use:

{cpmain.courtdate} = currentdate-dayofweek(currentdate,crMonday) + 3

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top