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

Help with eliminateing weekends from a weekly schedule

Status
Not open for further replies.

MHMGraifx

Technical User
Feb 23, 2004
2
US
Hi, I am trying to set up a scheduling system that runs on the formula that (current date) = 1 = (production date). but my problem is that I can not elimanate weekends (Sat. & Sun) from my schedule. Is there a formula that will do such in Crystal Reports 8??

Thank you

Mitchell
 
How about presenting your formula one more time, since you have two ='s there.

-LB
 
Sorry for the first post :)

Hi, I am trying to set up a scheduling system that runs on the formula that (current date) + 1 = (production date). but my problem is that I can not elimanate weekends (Sat. & Sun) from my schedule. Is there a formula that will do such in Crystal Reports 8??

Thank you

Mitchell
 
Not clear whether production date is a variable or an actual database field, or whether you are trying to create a record selection formula. To generate a production date within the report, you could create a formula like:

whileprintingrecords;
datevar productiondate;

If dayofweek(currentdate) in 1 to 5 then productiondate := currentdate + 1 else if
dayofweek(currentdate) = 6 then productiondate := currentdate + 3 else if
dayofweek(currentdate) = 7 then productiondate := currentdate + 2;
productiondate;

-LB
 
What LB is starting to ask for is more technical information, such as:

Crystal version
Database used
Example data
Expected output

Using text descriptions to provide a spec will likely net more questions, if not confusion, so simplify everyone's life and demonstrate the environment and requirement.

To eliminate weeknds (and if you need to eliminate Holidays as well you should so state) from data returned from the database try Report->Edit Selection Formula->Record:

day({table.date}) in [1 to 5]
and
{table.date} >= currentdate+1

This is just a wild guess of course, you've given no indication as to where this might be used, nor for what prupose, amongst the other unknowns.

Hope it helps though.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top