'Translate a T-SQL query to an Access query

I have a T-SQL query that I need to change to an Access query. I tried a lot of times to change it but no success

UPDATE  T1
SET    Cap = ((txg*T2.Cap)/100 ),   
        IPi=(case when t2.TPi=1 then ((txg*T2.IPiTT)/100) else T1.IPi end)
FROM   prg T1
       JOIN main T2
         ON T1.id = T2.id
where T1.Cap=0


Solution 1:[1]

Use IIF in Access SQL:

UPDATE
    T1
SET
    Cap = txg * T2.Cap / 100,   
    IPi = IIF(T2.TPi = 1, txg * T2.IPiTT / 100, T1.IPi)
FROM
    prg AS T1
INNER JOIN 
    main AS T2
    ON T1.id = T2.id
WHERE 
    T1.Cap = 0

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gustav