Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: issues with formula Post Reply Post New Topic
Author Message
ajp42
Newbie
Newbie


Joined: 26 Mar 2013
Online Status: Offline
Posts: 28
Quote ajp42 Replybullet Topic: issues with formula
    Posted: 10 Dec 2014 at 5:31am

I have an issue with the below - trying to get the below data
I need to add a column and put formula in that says
If the Entry Date and Trans date are the same day then put "Yes" else put "No"
But I need it to be by the "order no" - as multiple lines could be on one order - so if some lines are not on the same trans date - then I need it to say "No" for all lines within that order

Order No     Entry Date     Trans Date     Days
0051494330     01/12/2014     01/12/2014     0
0051494330     01/12/2014     01/12/2014     0
0051494330     01/12/2014     01/12/2014     0
0051494330     01/12/2014     01/12/2014     0
0051494330     01/12/2014     01/12/2014     0
0051494330     01/12/2014     01/12/2014     0
0051494330     01/12/2014     05/12/2014     4
0051494330     01/12/2014     05/12/2014     4
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Dec 2014 at 5:59am

is your days a field in the table or are you deriving that using a datediff() formula.

You can group on orderno
sum the Days field (or formula)
create a YES/NO result from that sum - if it is <>) then No else Yes


Edited by DBlank - 10 Dec 2014 at 5:59am
IP IP Logged
ajp42
Newbie
Newbie


Joined: 26 Mar 2013
Online Status: Offline
Posts: 28
Quote ajp42 Replybullet Posted: 10 Dec 2014 at 6:02am
It is a days field which I have adjusted
Unsure what you mean - I understand the grouping of Ord no - but not sure how to get them all to say No if they are different dates
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Dec 2014 at 6:20am
sum the days field at the group
if the value = 0 then all rows have a 0, if it is >0 then at least one row has a value not=0
if sum(days,orderNo)=0 then 'Yes' else 'No'
this is a group condition and can be placed in the detail section to show a consistent value (yes or no) for all rows in the entire group


Edited by DBlank - 10 Dec 2014 at 6:21am
IP IP Logged
ajp42
Newbie
Newbie


Joined: 26 Mar 2013
Online Status: Offline
Posts: 28
Quote ajp42 Replybullet Posted: 10 Dec 2014 at 10:14pm
Thanks for this - sorted it out now
Thanks again
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.016 seconds.