G
Guest
How would i write a function that would return one value if field CLASS is
"A" and another if it is "B"
"A" and another if it is "B"
How would i write a function that would return one value if field CLASS is
"A" and another if it is "B"
KARL DEWEY said:If there are only the two possible values then use --
IIF([CLASS]="A", 55, 44)
If there are more than those two possibilities then maybe use this --
IIF([CLASS]="A", 55, IIF([CLASS]="B", 44, Null), "Error")
f2rox said:How would i write a function that would return one value if field CLASS is
"A" and another if it is "B"
f2rox said:I'm sorry, I did not make myself clear.
I want the query to look up the value from another table.
If CLASS in table NAMES is "A", I want to return a value from table CLASSES
field A
If CLASS in table NAMES is "B", I want to return a value from table CLASSES
field B
KARL DEWEY said:If there are only the two possible values then use --
IIF([CLASS]="A", 55, 44)
If there are more than those two possibilities then maybe use this --
IIF([CLASS]="A", 55, IIF([CLASS]="B", 44, Null), "Error")
f2rox said:How would i write a function that would return one value if field CLASS is
"A" and another if it is "B"
KARL DEWEY said:field A
How is it to know which record in the CLASSES table?
f2rox said:I'm sorry, I did not make myself clear.
I want the query to look up the value from another table.
If CLASS in table NAMES is "A", I want to return a value from table CLASSES
field A
If CLASS in table NAMES is "B", I want to return a value from table CLASSES
field B
KARL DEWEY said:If there are only the two possible values then use --
IIF([CLASS]="A", 55, 44)
If there are more than those two possibilities then maybe use this --
IIF([CLASS]="A", 55, IIF([CLASS]="B", 44, Null), "Error")
:
How would i write a function that would return one value if field CLASS is
"A" and another if it is "B"
f2rox said:There is a field in table CLASSES called CLASSNUM and a field in table NAMES
called CLASSNUM. So the query pulls values from the corresponding record in
CLASSES table
KARL DEWEY said:field AIf CLASS in table NAMES is "A", I want to return a value from table CLASSES
How is it to know which record in the CLASSES table?
f2rox said:I'm sorry, I did not make myself clear.
I want the query to look up the value from another table.
If CLASS in table NAMES is "A", I want to return a value from table CLASSES
field A
If CLASS in table NAMES is "B", I want to return a value from table CLASSES
field B
:
If there are only the two possible values then use --
IIF([CLASS]="A", 55, 44)
If there are more than those two possibilities then maybe use this --
IIF([CLASS]="A", 55, IIF([CLASS]="B", 44, Null), "Error")
:
How would i write a function that would return one value if field CLASS is
"A" and another if it is "B"
KARL DEWEY said:Post the table structure and sample data.
f2rox said:There is a field in table CLASSES called CLASSNUM and a field in table NAMES
called CLASSNUM. So the query pulls values from the corresponding record in
CLASSES table
KARL DEWEY said:If CLASS in table NAMES is "A", I want to return a value from table CLASSES
field A
How is it to know which record in the CLASSES table?
:
I'm sorry, I did not make myself clear.
I want the query to look up the value from another table.
If CLASS in table NAMES is "A", I want to return a value from table CLASSES
field A
If CLASS in table NAMES is "B", I want to return a value from table CLASSES
field B
:
If there are only the two possible values then use --
IIF([CLASS]="A", 55, 44)
If there are more than those two possibilities then maybe use this --
IIF([CLASS]="A", 55, IIF([CLASS]="B", 44, Null), "Error")
:
How would i write a function that would return one value if field CLASS is
"A" and another if it is "B"