Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: count week and weekend days Post Reply Post New Topic
Author Message
coolfire
Newbie
Newbie


Joined: 04 Aug 2015
Location: Canada
Online Status: Offline
Posts: 5
Quote coolfire Replybullet 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 IP Logged
praveeng
Senior Member
Senior Member
Avatar

Joined: 11 Jul 2011
Online Status: Offline
Posts: 165
Quote praveeng Replybullet 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 IP Logged
coolfire
Newbie
Newbie


Joined: 04 Aug 2015
Location: Canada
Online Status: Offline
Posts: 5
Quote coolfire Replybullet 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 IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.