Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Like but not like Post Reply Post New Topic
Author Message
NCBeach4Me
Newbie
Newbie
Avatar

Joined: 28 Sep 2009
Location: United States
Online Status: Offline
Posts: 15
Quote NCBeach4Me Replybullet Topic: Like but not like
    Posted: 26 May 2010 at 3:30am
I'm whatever you would consider before a Crystal begninner.  It basically boggles my brain.  Here's my issue...
 
Two fields in my report:
Acct#    and    district.
 
Each acct# can have multiple districts.  So essentially one could look like this:
 
Acct#             district
12345            downtown
12345 (same)uptown
12345 (same)midtown
 
So...when I try to do a select query and choose any acct# that do not have a district of downtown....I still get ones like this one that are listed in uptown or midtown.  Because Crystal thinks, 'Okay...I won't give you the one that says downtown for that acct # but I'll give you the ones that DON'T say downtown because they fit your simple logic."
 
I understand why Crystal does this...I just don't understand how to get the results I want.  Basically...I want any and all acct#'s that look do NOT have downtown listed for them.
 
For example, I would want one that looks like this:
 
Acct#           district
4567            uptown
4567            midtown
 
This one doesn't have downtown as a district.  I want only these to show up in my report.
 
I'm not sure if this is something I do in Grouping or if it's something I do with an if else statement.  I'm SQL stupid too...so be gentle if that's my recourse.
 
And thanks in advance for any help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 May 2010 at 3:39am

Group on account # field.

Create a formula field to 'flag' your downtown rows as DTcount (or whatever you want to name it)
if table.district='downtown' then 1 else 0
Now insert a summary as a SUM using this formula field at the account # group level
click on the sigma sign
select the @DTcount field
set as a SUM
location in the group 1 footer
OK
Go to the select expert
Show formula
select group selection toggle
click on formual editor
add your select criteria here of the SUM=0, somehting like
SUM({@DTCount}, {table.acctountNo})=0


Edited by DBlank - 26 May 2010 at 3:40am
IP IP Logged
NCBeach4Me
Newbie
Newbie
Avatar

Joined: 28 Sep 2009
Location: United States
Online Status: Offline
Posts: 15
Quote NCBeach4Me Replybullet Posted: 26 May 2010 at 4:17am
OMGosh.  It worked perfectly.  This must be how my end users feel when they're trying to use the number pad, the Num Lock isn't on and all I do is press the Num Lock button.
 
Seriously...I'm sure that was simple for you...and I thank you SO MUCH for putting into simple terms so that I could make it work.
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.047 seconds.