Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Select Records - Need help in Query Post Reply Post New Topic
Author Message
mixxy2
Newbie
Newbie


Joined: 23 May 2012
Online Status: Offline
Posts: 2
Quote mixxy2 Replybullet Topic: Select Records - Need help in Query
     Posted: 24 May 2012 at 3:20am
Hi everyone!
First time post, love the site.....
 
So this is probably something very easy and I am overthinking it....
 
Im trying to build a report that selects the following records:
For example - I have one field that I'm trying to select with certain criteria and if it meets that certain criteria show me the other records...
 
Ex.
[STORE]        [TOYS]
Target           Cars
Target           Trucks
Kmart            Airplanes
Kmart            Trucks
 
So for this report - I want to show those stores with at least Cars and if you have cars show me what else you have....so my results should be
 
Target          Cars
Target           Trucks
 
Can anyone help me??  THANKS!!!Smile
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 May 2012 at 3:57am
you can do this with a inner join in a command or view or stored proc with an and statment on the join
or
in crystal you can use the group select option
group on store
create a formula feild to 'flag' your car rows
If table.toy='cars' then 1
sum the flag at the group level of store
sum(@flag,table.store)
and group with a sum>0 has a car so you use that in the select expert set to group criteria
sum(@flag,table.store)>0
IP IP Logged
mixxy2
Newbie
Newbie


Joined: 23 May 2012
Online Status: Offline
Posts: 2
Quote mixxy2 Replybullet Posted: 24 May 2012 at 9:32am
dblank thank you so much for this - i figured it out with the help of your suggestions - as a novice, are there any books that would assist me with Crystal that you would recommend?  Many thanks!!!
 
Smile
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 May 2012 at 9:35am

Get Brian's book from this site (I do not work for this site or get any thing from it).

Read as many posts as you can and try to replicate the problems and solutions.
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