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
che ovviamente non è corretta.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))
sapete aiutarmi per cortesia?