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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Complicated parameter

Status
Not open for further replies.

vshapiro

Programmer
Jan 2, 2003
211
US
Is it possible to create the following parameter?...

The field StaffID has many different ID's (SJM, LRD, RTV..)
My parameter now :

(if {?CoMng} <> &quot;All&quot; then
({PACS_PROJECT_STAFF.STAFF_ID}) = {?CoMng}
else if {?CoMng} = &quot;All&quot; then true).

How can I let user select &quot;All&quot; without one particular person?

For example user wants All without SJM.
 
I'd use two parameters. The first says include one, exclude one or all. The second says which should be included or excluded, and is ignored if you said all.

Madawc Williams
East Anglia, Great Britain
 
Just create another line of code and another parameter value:

Parameter values: ALL, All w/o SJM, SJM, LRD, RTV.....

Formula:
if {?CoMng} = &quot;All&quot; then true else
if {?CoMng} = &quot;All w/o SJM then {PACS_PROJECT_STAFF.STAFF_ID} <> &quot;SJM&quot; else
{PACS_PROJECT_STAFF.STAFF_ID} = {?CoMng}

You will need to create default parameter values to do this.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
I find out that I have one problem. Report grouped by project#. The table has many records for one project# and different StaffID because StaffID could be Type01 or 02 or 03...etc.
It looks like:
Proj# StaffID StaffType
111 SJM 01
111 VBN 05
111 TGF 03...

I need only StaffType 01 which is OK. But, when I create this line of code for the parameter and StaffType not the first record for particular Proj# it returns null.
For &quot;All&quot; it works OK....??
 
(if {?CoMng} <> &quot;All&quot; and {PACS_PROJECT_STAFF.STAFF_ACTIVE} <> &quot;N&quot;
and {PACS_PROJECT_STAFF.STAFF_TYPE} = '01' then
({PACS_PROJECT_STAFF.STAFF_ID}) = {?CoMng}
else if {?CoMng} = &quot;All&quot; then true)

this is working OK. But in PACS_PROJECT_STAFF one Project# could have many records with different STAFF_TYPE and STAFF_ACTIVE and when it's grouped and &quot;01&quot; not the first record it does not work

Thank you very much
 
You said:

in PACS_PROJECT_STAFF one Project#

Which field in PACS_PROJECT_STAFF ?

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
I think you should separate the other conditions from the parameter clauses as in:

(if {?CoMng} <> &quot;All&quot; then
{PACS_PROJECT_STAFF.STAFF_ID} = {?CoMng}
else if {?CoMng} = &quot;All&quot; then true) and
{PACS_PROJECT_STAFF.STAFF_ACTIVE} <> &quot;N&quot; and {PACS_PROJECT_STAFF.STAFF_TYPE} = '01'

If there are staff ID's selected by the parameter that don't then meet the other conditions, they will still be excluded, even though selected by the parameter.

I might be misinterpreting your goal here though...

-LB
 
dgillz!

Yes, One Project (for example Project # 123) could have number of records because one project # has one Manager (staffType 01) one Supervisor (staffType 02) one Regional manager (StaffType 03)...etc. All of this are separate records in the same table
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top