| Author |
Message |
coolfire
Newbie
Joined: 04 Aug 2015
Location: Canada
Online Status: Offline
Posts: 5
|

Topic: count week and weekend days Posted: 03 Sep 2015 at 10:46am |
|
How am I going to count the days exclude weekend
Example 1
DateOrd = 08/03/2015
DateCom = 08/10/2015
Days completed should be 5 not 7
Example 2
DateOrd = 08/03/2015
DateCom = 08/07/2015
Days completed should be 4
|
IP Logged |
|
|
|
praveeng
Senior Member
Joined: 11 Jul 2011
Online Status: Offline
Posts: 165
|

Posted: 07 Sep 2015 at 2:25am |
|
Hi,
If you want to exclude only Saturday and Sunday then use below formula :
Local DateTimeVar d1 := {Orders.Order Date};
Local DateTimeVar d2 := {Orders.Ship Date};
DateDiff ("d", d1, d2) - (DateDiff ("ww", d1, d2, crSaturday) - DateDiff ("ww", d1, d2, crSunday))
--Praveen G
|
|
Praveen Guntuka,
praveen_guntuka@yahoo.com
|
IP Logged |
|
coolfire
Newbie
Joined: 04 Aug 2015
Location: Canada
Online Status: Offline
Posts: 5
|

Posted: 08 Sep 2015 at 6:43am |
|
Thank you very much Praveen. Appreciated your help!
It worked exactly what I needed once I removed the bracket from Sat and Sunday
Local DateTimeVar d1 := {Orders.Order Date};
Local DateTimeVar d2 := {Orders.Ship Date};
DateDiff ("d", d1, d2) - DateDiff ("ww", d1, d2, crSaturday) - DateDiff ("ww", d1, d2, crSunday)
|
IP Logged |
|
|
|