Ciao a tutti
non riesco a cpaire come devo fare una query di update con una condizione all' interno

in pratica ho la tabella timbrature

ID = intero
ORE = intero
MINUTI = intero
IMPORTO_TOTALE = decimale
TARIFFA_A = intero
TARIFFA_B = intero

l'IMPORTO_TOTALE dovrebbe essere calcolato così:
se la TARIFFA_B = 0 allora
IMPORTO_TOTALE = ((TARIFFA_A*ORE)+(TARIFFA_A*MINUTI ))
altrimenti
IMPORTO_TOTALE = ((TARIFFA_B *ORE)+(TARIFFA_B *MINUTI ))

la mia query è questa


END IF
codice:
  Update timbrature_mag
    IF TARIFFA_B=0 THEN IMPORTO_TOTALE =((TARIFFA_A*ORE)+(TARIFFA_A*MINUTI))
    ELSE IMPORTO_TOTALE =((TARIFFA_B*ORE)+(TARIFFA_B*MINUTI))
che ovviamente non è corretta.
sapete aiutarmi per cortesia?