I need help for this complex sql statement. In a select query, I need to add a statement to a calculated field with this structure:
If Field1 = 'value1' then
If Field2 = 0 then FCalculated1 = FieldA * FieldB
else FCalculated1 = FieldA * FieldC
end
FCalculated2 = FCalculated1 * FieldA
else if Field1 = 'value2' then
If Field2 = 0 then FCalculated2 = FieldD * FieldB
else FCalculated2 = FieldD * FieldE
end
FCalculated1 = FCalculated2 / FieldA
end
Basically I need to nest one conditional within another and use a calculated field as the source of another field. Does anyone can help me?
Thank you!!!
Try this
I mean I’ve used variables to get it to compile and test, just swap out the @ signs for your column names