Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: parameter not working Post Reply Post New Topic
Author Message
bluelake
Newbie
Newbie
Avatar

Joined: 08 Jul 2010
Online Status: Offline
Posts: 24
Quote bluelake Replybullet Topic: parameter not working
     Posted: 13 Feb 2012 at 6:20am

I work in the healthcare field.  I have created a report using two tables: Table A which contains the information for services provided and Table B which shows payments for services.  I used a date range parameter for the date of service and the report works fine.  However I have problems if I add a parameter for the guarantor.  The report will pull data if the guarantor is in table B(payments received), but it won't pull data if the guarantor is not in table B.  I have the tables linked by Patient ID, date of service, Guarantor ID.

IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 13 Feb 2012 at 6:29am
if you want the report to pull date f the guarantor is not in table B then its
eather you need something like
(
b.guarantor= parameter or
isnull(b.guarantor)
)
or something with links
change the like to left outer join

IP IP Logged
bluelake
Newbie
Newbie
Avatar

Joined: 08 Jul 2010
Online Status: Offline
Posts: 24
Quote bluelake Replybullet Posted: 13 Feb 2012 at 7:45am
I tried both of these and it still doesn't work.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Feb 2012 at 7:58am
Kostya gave you good feedback on this so you may need to tweak it to get it to work for your data set.
you will need to outer join your tables so you pull all records from Table A.
You likely need to join on the serviceid, not triple join you are doing. You may even need a third table that is the intermediate table of the two you are using.
You also have to be careful how you write your select stament as this can make an outer join into an inner join.
Whenever dealing with NULLs you have to make that the first part of your statement.
(isnull(table.field) or table.field=?param)
and
table.date in ?begindate to ?enddate


Edited by DBlank - 13 Feb 2012 at 7:59am
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