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!

Record Selection Problem 1

Status
Not open for further replies.

robinsql

Programmer
Aug 2, 2002
236
IE
This selection formula takes the parameters and returns the appropriate records. If I enter the parameters as 0, I get all records returned. If I want to have an option to return all records except ones where {?WornOut} = 29, how do I do it?
Anyone got any ideas? Thanks for any help.

(If {?Config} <> 0
Then {VPerformance.Config ID} = {?Config}
Else
If {?Config} = 0
Then True) and
(If {?WornOut} <> 0
Then {VPerformance.RemovalID} = {?WornOut}
Else
If {?WornOut} = 0
Then True)
 
Code:
(If {?Config} <> 0
Then {VPerformance.Config ID} = {?Config}
Else
    If {?Config} = 0
    Then True) and
(If {?WornOut} <> 0
Then {VPerformance.RemovalID} = {?WornOut}
Else
    If {?WornOut} = 0
    Then {VPerformance.RemovalID} <> 29)
Such a change would mean that you always omitted 29. If you wanted the user to drive the dumping of 29, you'd have to account for this in your parameter prompt, and use the parameter prompt to include the above change.

i.e.
Code:
...(If {?WornOut} <> 0 
Then {VPerformance.RemovalID} = {?WornOut}
Else
	If {?WornOut} = 0 and {?No29s} = 'True'
	Then {VPerformance.RemovalID} <> 29)
	Else
		If {?WornOut} = 0 and {?No29s} = 'False'
		Then True)

Note {?No29s} is a new parameter.

Naith
 
There should be no ')' after the last 29. Sorry about that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top