Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Logic behind suppressing fields Post Reply Post New Topic
Author Message
zach18
Groupie
Groupie
Avatar

Joined: 08 Feb 2011
Online Status: Offline
Posts: 46
Quote zach18 Replybullet Topic: Logic behind suppressing fields
     Posted: 29 Apr 2011 at 5:22am
I have the following SQL:

   select distinct inspectionid, stationid from
   StationInspection
   where stationid=2
   

that will give me a list of all inspectionid and stationid's where station id is 2. that works great. the problem is i want to surppress a "NOT FINIHSED" if a 2 doesn't exist with a certain inspectionid (which is the only parameter in the report). to surppress the text i am using the following code:
   
   {Command.stationid} = 2

Command is the SQL i inserted into the report, which is the SQL i pasted above.

the report is going from the actual SQL table to the SQL above.

the problem is i can check the SQL with an inspection id that DOESN'T have a stationid that is equal to 2, but the text stays suppressed when it should be showing.

any suggestions are gladly accepted

Edited by zach18 - 29 Apr 2011 at 6:57am
Using Crystal Report 2008
www.zachtech.us
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 29 Apr 2011 at 6:35am
You're suppressing all stationid's that have value of 2.
Is that what you are looking for?

Edited by Keikoku - 29 Apr 2011 at 6:36am
IP IP Logged
zach18
Groupie
Groupie
Avatar

Joined: 08 Feb 2011
Online Status: Offline
Posts: 46
Quote zach18 Replybullet Posted: 29 Apr 2011 at 7:00am
correct. if the station id is 2, i want the text to be suppressed.
Using Crystal Report 2008
www.zachtech.us
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 29 Apr 2011 at 7:35am
I am confused by what you mean here:

the problem is i can check the SQL with an inspection id that DOESN'T have a stationid that is equal to 2, but the text stays suppressed when it should be showing.


Consider re-phrasing.
IP IP Logged
zach18
Groupie
Groupie
Avatar

Joined: 08 Feb 2011
Online Status: Offline
Posts: 46
Quote zach18 Replybullet Posted: 29 Apr 2011 at 8:01am
when i excute the SQL
   select distinct inspectionid,stationid
   from StationInspection
   where stationid=2
in the sql server management studio it brings back a list of all the inspection numbers that are equal to 2. To verify i was right, i added WHERE inspectionid = 12345(which is the inspection id i want to check for station 2). The query came back blank, suggesting that the particular inspectionid did not have a stationid = 2. the suppressed text should then show up, but it doesnt.

Edited by zach18 - 29 Apr 2011 at 8:02am
Using Crystal Report 2008
www.zachtech.us
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 29 Apr 2011 at 8:30am
it brings back a list of all the inspection numbers that are equal to 2


Actually, from the query you posted, it returns a set of records where the stationid equals 2.

I would then assume that since your suppression formula suppresses records that have stationid = 2, it would suppress all records.
IP IP Logged
zach18
Groupie
Groupie
Avatar

Joined: 08 Feb 2011
Online Status: Offline
Posts: 46
Quote zach18 Replybullet Posted: 02 May 2011 at 4:30am
that's what i was missing, i just needed to make sure the result wasn't null. it works now.
Using Crystal Report 2008
www.zachtech.us
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