Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Criteria with dates formula Post Reply Post New Topic
Author Message
Mebaby3
Newbie
Newbie
Avatar

Joined: 22 Apr 2014
Location: United States
Online Status: Offline
Posts: 7
Quote Mebaby3 Replybullet Topic: Criteria with dates formula
     Posted: 14 Aug 2014 at 10:27am
So I am working on a report and a part of the criteria for the report is the received date (LastReceiptDate) has to be 7 or more days less than the promised date (PromisedDate). I also need to do this only based on business days which are Monday through Friday.

Can someone help me?

I have the basics of the report begun... I have the date currently just set to less than because I do not know exactly how to write the formula to actually compare days and everytime I work with these fields it becomes confusing because they are datetime fields and not just date fields.

Update

I am using this formula

WhileReadingRecords;
DateVar Array Holidays;
DateVar Target:={@Date}; 
NumberVar Add:= -7;
NumberVar Added := 0;

WHILE Added > Add
Do (target := target -1;
    if dayofweek (target) in 2 to 6 and not (target in holidays)
        then Added:=Added-1
        else Added:=Added);
Target

I figured it out

Thanks anyway :)



Edited by Mebaby3 - 14 Aug 2014 at 1:17pm
The eye sees only what the mind is prepared to comprehend.
Robertson Davies
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