I am trying to do a select from query.
I have a variable tpilotid which contains a number from 1 - 1000 and corresponds with a column in a table called pilots.
what i'm trying to achieve is this.
if tpilotid = a value from the pilots column then select the value from column rankid.
I have really struggled to get this to work.
SELECT rankid from pilots WHERE rankid = ('tpilotid')
I am then trying the revquery from the tools menu and populating a field with the columns pilotid and rankid.
i was then going to do something like this.
Code: Select all
if tpilotid = char 1 to 3 of column 1 of field "rankid" then
put char 4 into trankid
end if
if trankid = "1" then
put field "flighttime" * 100 into tpilotpay
put tpilotpay into field "pilotpay"
else if trankid ="2" then
put field "flightime" * 180 into tpilotpay
put tpilotpay into field "pilotpay"
end if
Thank You
Alex