Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Yes / No Parameter

Status
Not open for further replies.

hlb6

Technical User
Aug 2, 2013
27
US
I have to add a Yes / No parameter to my report. Yes = user wants to see the department and no = they don't. Not sure how to go about doing this - this is a new realm for me. I know it is an If statement - how do I get it into the parameter vales parameter dialog box?

Here is my Crystal / Select Expert Queries:

Crystal SQL:
SELECT distinct xvd.xvd_display, ock.bra_id, ock.dpr_id, ock.usr_id, ock.lbc_id,ock.ock_d_start, ock.ock_d_end, ock.ock_status, ock.ock_reason,
ofh.ofh_doc_id, ofh.cpy_id, bra.bra_screen

FROM orl INNER JOIN
xvd ON orl.lbc_id = xvd.xcv_id INNER JOIN
ock ON orl.ofh_id = ock.ofh_id and
orl.usr_id = ock.usr_id AND orl.lbc_id = ock.lbc_id INNER JOIN
ofh ON orl.ofh_id = ofh.ofh_id
INNER JOIN bra ON ock.bra_id = bra.bra_id
WHERE (xvd.xcd_id = '13') AND (xvd.lng_id = 0) AND (ock.ock_d_start >= {?p_Start_Date}) and (ock.ock_d_end <= dateadd(d,1,{?p_End_Date}))
order by ofh_doc_id

Select Expert SQL:
({?p_Company} = "All" or {Command.cpy_id} in {?p_Company}) and
({?p_Technician} = "All" or {Command.usr_id} in {?p_Technician}) and
({?p_Branch} = "All" or {Command.bra_id} in {?p_Branch})
 
If it's just a matter of whether or not to see one field, then you don't need to modify your SQL.

Just create a string parameter, and make the allowable values YES and NO.

Add the department field to your report, then right-click on it and choose Format Field.
Click on the Common tab.
You'll see a checkbox for Suppress - go to the right of that and click the blue "X-2" box.

in the new sindow that opens put {?Show Department} = 'NO' (Show Department is the name of the parameter)
Save - Close - Done
 
Okay - Did as directed - when I say yes in the parmaeter box the field writes yes - I need it to show the department id
 
Oh, yeah i'm using Crystal 9
 
This is what I put in the Selection Expert for the group footer

if{?p_Department} = "No" then True else {?p_Excel} I also checked the suppress

Thanks to direction to go!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top