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

Use field value as Comparison Operation? 1

Status
Not open for further replies.

ThinWhiteDude

Technical User
Sep 21, 2004
97
US
Hi everyone,

Not sure how to tackle the follow structural puzzle, but would surely appreciate some ideas, advice, input. Am working with version 2002.

My customer has a table which tracks pieces of equipment, and lists a series of values to be used as "bad" operation comparisons. Example follows:

Item Comparison Value Comparison Operator

Plate Valve 45 <=
Hinge Breaker 120 >=
Dotmer Box 75 <=

A second table tracks entries on equipment that have deviated from normal performance. That table tracks, among other things, the duration and hourly readings. As you can see above, for some pieces of equipment, if the average of the hourly readings goes over (or equal to) the comparison value, they are considered "bad;" but for other pieces, if they go under (or equal to) that value, they are "bad."

I'm at a loss as to how to deal with setting this up . . . do I make a field of these operators? And if so, how do I incorporate them into a QBE to produce a report of all "bad" equipment deviations?

Thank you, as always for any help,
TWD
 
If you have your operators as the value in a field then you can use immediate IF (i.e. IIF) statements to sort it out like this

Code:
   IIF (Operator = "<=", 
            IIF ( [Item] <= [Value], "Bad", "Good" ),
            IIF ( [Item] >= [Value], "Bad", "Good" ) )

It gets much messier if you have multiple comparison operators such as "=", "<>", "<", ">", "<=", ">=".
 
Golom,

It may be messy, but it works a charm. Thanks for your guidance, and here's a star.

TWD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top