Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Date / Time Diff less weekends Post Reply Post New Topic
Author Message
ravenous
Newbie
Newbie


Joined: 24 Sep 2014
Location: United States
Online Status: Offline
Posts: 7
Quote ravenous Replybullet Topic: Date / Time Diff less weekends
     Posted: 10 Dec 2014 at 9:26am
Hey Gang,
I have a problem that I can't figure out. I'm having a hard time finding the number of minutes between 2 date-times not counting the weekends. My formula is not removing the weekends from the results.
Thoughts?

DateTimeVar d1 := CDateTime(Date({Asgnmnt.DateAssign}),Time({Asgnmnt.TimeAssign}));
DateTimeVar d2 := {@date and time resolved};
DateDiff ("n", d1, d2) - DateDiff ("ww", d1, d2, crSaturday) - DateDiff ("ww", d1, d2, crSunday)

Edited by ravenous - 10 Dec 2014 at 10:39am
IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet Posted: 15 Dec 2014 at 3:19am
this one comes up a bit, try this solution http://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=16195
you will need to change for minutes.
IP IP Logged
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