We help IT Professionals succeed at work.

IIF syntax in MS Access

LuckyLucks
LuckyLucks asked
on
188 Views
Last Modified: 2017-04-03
Hi:


 I have two tables in Access that I want to compare each of the two columns in both tables and if they match output the third column in the 2nd table. I am trying to do the below but it complains of syntax error

Select A.*
       , IIF(A.col1=B.col2, (A.col2=B.col2, B.col3,"No match"),"No match") as Final_val
from A, B;

Also, B is a lookup table so not sure if I have better options than a cartesian join.
Comment
Watch Question

Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION