Could not add the table....

rpadminserver

Board Regular
Joined
Nov 7, 2007
Messages
111
Office Version
  1. 365
Hello Friends.
I'm trying to put a IIF statement in my access SQL
Here is the statement

select a.id,a.mfr
iif(a.mfr !=(select alias from propermfr),"CHECK MFR",0)as REASON
from test4a a

I keep getting "Could not add the table propermfr"

Help please
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I am not sure what you are trying to do, or the relationships, but it appears that you have two tables (test4a, propermfr). If that is the case, then join them in your query first before you start doing calculations on their fields.
 
Upvote 0
What I'm attempting to do is see if A.MFR is in the list of ALIAS that I'm pulling from propermfr.

There is no join to be made.

If I was doing this in real sql (not this access version of sql) i would write it like this:

selext a.id, a.mfr,
(case when a.mfr not in (select distinct alias from popermfr) then "CHECK MFR" else null end) as reason
from test4a a
 
Upvote 0
There is no join to be made.
This could be done using joins, i.e.
Code:
SELECT DISTINCT 
   mfr.ID
   , mfr.mfr
   , IIf(IsNull([propermfr]![alias]),"Check mfr","") AS reason
FROM 
   mfr 
LEFT JOIN 
   propermfr ON mfr.mfr = propermfr.alias;
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,794
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top