Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: DateDiff - 0 days Post Reply Post New Topic
Author Message
mrdaddysmith
Newbie
Newbie
Avatar

Joined: 29 Jan 2013
Online Status: Offline
Posts: 2
Quote mrdaddysmith Replybullet Topic: DateDiff - 0 days
     Posted: 30 Jan 2013 at 4:48am

I am new to crystal reports and have been asked to produce a report that calculates the number working of days (not counting sat and sun) taken to process an application form. 

It needs to count:

 (The datediff between Application Received and Letter issued to customer ) + (The datediff between Letter received from customer and Further notification sent to customer) - (Any Saturdays and Sundays that fall between these dates). 

e.g  App received 28/01/13, Letter to cust 28/01/13 = 0 days      
       Letter received from cust 30/01/13, Notification to cust 30/01/13  = 0 days
 
       - therefore number of days to process the application would be 0 days
 

I have managed to get working but my issue is that if the datediff is zero days then I need this to show as 1 day. 

Is there any way to add 1 day when the date diff is 0? I only want to add 1 day when it is 0 days

Hope that makes sense

 

IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 31 Jan 2013 at 11:17pm
Hi

You can drag your entire formula into one condition and check whether it is 0 or more than a 0.

i.e.

if {datediff1}+{Datediff2}-{sat&sunday} = 0  then 1
else
{datediff1++{Datediff2}-{sat&sunday}




Edited by Sastry - 31 Jan 2013 at 11:17pm
Thanks,
Sastry
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