SELECT FROM Amibiguous Column Name

guest

Board Regular
Joined
Feb 21, 2002
Messages
91
Hi,

I have the following SQL:

Code:
SELECT WO.WONUM, WO.UD1, WOEQLIST.UD2, WO.TASKNUM
FROM WO, WOEQLIST
WHERE WONUM not in (select distinct WONUM from WOP) And UD1 Is Not Null And UD2 <>'9000' And UD2 <>'9001' And TASKNUM Like '%STK%'

I keep on getting ambiguous column name 'WONUM', 'UD1' and 'UD2', statement could not be prepared.

I do not know why this is happening - there are definitely columns with this name in WO. Please help!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I realise that it is because WONUM and UD1 & UD2 also exist in WOEQLIST, but I am differentiating which table each should come out of in the code. Why does it not identify this?
 
Upvote 0

Forum statistics

Threads
1,221,567
Messages
6,160,541
Members
451,655
Latest member
rugubara

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