M
Mike H
Aim: To create a field, ST, in a query, the data in the field to be
determined by data in two other fields. i.e. If field Class = B then
field ST= field Time * ER
Existing field: Class has text data in the form of either, A; B; C; D;
Existing field: Time has number data in form of 220.20; 340.45 etc.
Existing field: ER has number data in form 0.987; 0.673 etc.
Required field: ST, to have data in number format similar to Time field.
I can enter an IIF function in a Select query design Field grid such as:
ST: IIf([Class]='B',[Time]*0.97974)
and this works giving me a result in the ST field record associated with
the Class field data 'B'
But, I want to modify the above expression so that it can handle more
than one value of the Class field calculating by a different value of
the Time field. I have tried:-
ST: IIf([Class]='B',[Time]*0.987) OR ST: IIf([Class]='C',[Time]*0.673)
This results in -1 being entered in the records associated with the
Classes 'B' and 'C'
I get the impression that the IIF function should solve the problem but
that I am using it either in the wrong type of query or in the wrong
context.
I hope the above is clear enough for someone to offer a suggestion as to
what to enter and where to put it, (genuine offers only please!!).
Regards
Mike H.
determined by data in two other fields. i.e. If field Class = B then
field ST= field Time * ER
Existing field: Class has text data in the form of either, A; B; C; D;
Existing field: Time has number data in form of 220.20; 340.45 etc.
Existing field: ER has number data in form 0.987; 0.673 etc.
Required field: ST, to have data in number format similar to Time field.
I can enter an IIF function in a Select query design Field grid such as:
ST: IIf([Class]='B',[Time]*0.97974)
and this works giving me a result in the ST field record associated with
the Class field data 'B'
But, I want to modify the above expression so that it can handle more
than one value of the Class field calculating by a different value of
the Time field. I have tried:-
ST: IIf([Class]='B',[Time]*0.987) OR ST: IIf([Class]='C',[Time]*0.673)
This results in -1 being entered in the records associated with the
Classes 'B' and 'C'
I get the impression that the IIF function should solve the problem but
that I am using it either in the wrong type of query or in the wrong
context.
I hope the above is clear enough for someone to offer a suggestion as to
what to enter and where to put it, (genuine offers only please!!).
Regards
Mike H.