Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: A record select formula Post Reply Post New Topic
Author Message
bremen
Groupie
Groupie
Avatar

Joined: 28 May 2013
Online Status: Offline
Posts: 93
Quote bremen Replybullet Topic: A record select formula
    Posted: 30 Apr 2014 at 7:57am
I am writing a report to show some purchasing data.

There are a few instances where we purchase services as well as good from a vendor.  When we create this type of purchase order there are two lines to distinguish a purchase of goods and a purchase for services.  In my database these are considered a purchase type of 1 and 2 respectively. 

I am looking for a way that will limit my report to only show me purchase orders that contain both a purchase type of and and 2 and show me both lines on that purchase order. 

is that clear as mud? 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Apr 2014 at 8:29am
if you can use a stored proc that would be one way.
if you want to write a command that would be another.
 
For a crystal solution you can group on the purchase order number
set a min and max summary of the purchase type on that group and use that as a group select criteria
e.g.
minimum(type,PO#)= 1 and maximum(type,PO#)=2
IP IP Logged
bremen
Groupie
Groupie
Avatar

Joined: 28 May 2013
Online Status: Offline
Posts: 93
Quote bremen Replybullet Posted: 01 May 2014 at 1:11am
Thank you. 

I also need to add one more criteria to this.  If I wanted to limit to particular type of service.... lets say office cleaning (which has a key of 4 in my DB) how would i encompass this to the with the above formula and still achieve the same result of showing both lines of the purchase order? 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 May 2014 at 3:56am

if you want to see all of the PO then you need another group criteria.

Create a 'flag' formula for the group
if table.type=4 then 1 else 0
now us that in the gorup criteria
sum(flag,PO#)>0
 
If you want to only see the ofice cleaning rows in the PO then you can use a record selection
table.type=4
IP IP Logged
bremen
Groupie
Groupie
Avatar

Joined: 28 May 2013
Online Status: Offline
Posts: 93
Quote bremen Replybullet Posted: 01 May 2014 at 5:23am
Awesome. 

thank so much for the help

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.