Solved

day of the year - weekends

Posted on 2006-11-14
3
318 Views
Last Modified: 2008-03-10
I used the days360(#1/1/2006#, maximum({InvMovements.EntryDate})) to get the day of the year.  I need a formula or something to exclude weekends. Any ideas?  

Thanks for any help.
0
Comment
Question by:ThomasBallardIT
  • 2
3 Comments
 
LVL 77

Expert Comment

by:peter57r
Comment Utility
Hi ThomasBallardIT,
You can get the number of workdays between 2 dayes using the formula here:
http://kenhamady.com/form01.shtml

Pete
0
 
LVL 3

Author Comment

by:ThomasBallardIT
Comment Utility
I don't need to deal with holidays, could you simplify that formula a bit.  
I'm not much at using variables, but if thats the best way then I will do it.
0
 
LVL 77

Accepted Solution

by:
peter57r earned 250 total points
Comment Utility
I have commented out the lines you don't need.  You can delete them if you wish.
You don't need the Holiday formula at all.

//Main formula
WhileReadingRecords;
Local DateVar Start := {StartDate};   // place your Starting Date here
Local DateVar End := {EndDate};  // place your Ending Date here
Local NumberVar Weeks;
Local NumberVar Days;
//Local Numbervar Hol;
//DateVar Array Holidays;

Weeks:= (Truncate (End - dayofWeek(End) + 1
- (Start - dayofWeek(Start) + 1)) /7 ) * 5;
Days := DayOfWeek(End) - DayOfWeek(Start) + 1 +
(if DayOfWeek(Start) = 1 then -1 else 0)  +
(if DayOfWeek(End) = 7 then -1 else 0);  

//Local NumberVar i;
//For i := 1 to Count (Holidays)
//do (if DayOfWeek ( Holidays[i] ) in 2 to 6 and
//    Holidays[i] in start to end then Hol:=Hol+1 );

Weeks + Days
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now