I'm having a hard time determining the best function to use and or query. I have a column of transaction codes that I need to reference and based on that code will determine what I need my new column to update to. (assuming update query is the best approach) there is a possibility of 7 different codes with a possibility of 4 different outcomes. not sure if I should use the iif or switch function or a combination of the two, if thats even possible.
the query/update/etc would be something to the effect of:
iif code equals 1 then subtract the dollars in column B and subtract total payment months in column D AND (these amounts need to be removed from my total sum of payments and number of payment months)
iif code equals 2 then add the dollars in column B and add the months in column D (there is another field in the table that I can reference to say use this number for payment months)
iif code equals 3 then add the dollars in column B and convert the months in column D to 0 (do not want them included in total payment months sum but need to still include the dollars in total payments)
iif code equals 4 then subtract the dollars in column B and payment months should be converted to 0 (same as above scenario)
there are 7 different codes due to different reasons assigned to the codes but how we calculate the dollars and payment months remains the same.
any guidance would be appreciated.....