Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Looking for a little help writing this formula Post Reply Post New Topic
Author Message
rybad80
Newbie
Newbie
Avatar

Joined: 18 Oct 2010
Location: United States
Online Status: Offline
Posts: 7
Quote rybad80 Replybullet Topic: Looking for a little help writing this formula
     Posted: 18 Oct 2010 at 6:05am
My database looks something like this
 
          Table 1                                               Table 2
Case  Physician Code     ------->   Physician Code   Name
 123            1                                             1             Dr Smith
 123            2                                             2             Dr Roberts
 124            1                                             3             Dr Jones
 125            1
 
and so on ....
 
I would like this to show up as
 
Case    Physician1     Physician 2 
123        Dr Smith       Dr Roberts
124        Dr Smith
125        Dr Smith
 
 
 
I brought in table 2 twice and aliased it as Table2_1.
 
@Physician 1 = if {Table1.Physician_Code} = 1 THEN {Table2.NAME}
@Physician 2 = if {Table2_1.Physician_Code} = 2 and {Table2.Physician_Code} = 1
THEN {Table.NAME}
What I get is
 
123   Dr Smith
123   Dr Smith           Dr Robert
124   Dr Smith
125   Dr Roberts
 
How can I eliminate the "duplicate" lines where the data fits the condition of having a value for Physician 1.  Does it have anything to do with a whileprintingrecords formula?
 
Thanks for the help!
 
 
IP IP Logged
Senthil Raj
Newbie
Newbie
Avatar

Joined: 02 Aug 2010
Location: India
Online Status: Offline
Posts: 27
Quote Senthil Raj Replybullet Posted: 19 Oct 2010 at 9:23pm
if you have more than 2 physician for 1 case then your logic will not work so try to use cross tab that will give you correct result with out duplication

Live And Let Live...
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