Avatar of LuckyLucks
LuckyLucks
 asked on

IIF syntax in MS Access

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.
Microsoft Access

Avatar of undefined
Last Comment
Gregory Miller

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Gregory Miller

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy