Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 How not to display a row depending on other rows.

Author  Topic 

Nosediver
Starting Member

7 Posts

Posted - 2007-10-08 : 06:52:46
Hi,
I accidentially posted in the wrong forum, so maybe you can help me on that

[url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=90631[/url]


Lars

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-10-08 : 06:56:14
I think this sould do
SELECT		f.[4DigitGCC],
f.[GLOBAL COMMODITY CODE DESCRIPTION (ENGLISH)],
f.SupplierCapabilitySEA,
f.[GLOBAL COMMODITY CODE DESCRIPTION (ENGLISH)],
x.Name,
x.Rating,
x.Criteria
FROM [4x4] AS f
INNER JOIN ASDBComplete AS x ON x.GCC = f.[4DigitGCC]
LEFT JOIN ASDBComplete AS y ON y.GCC = f.[4DigitGCC]
AND y.Rating IN ("green", "yellow")
WHERE x.Rating = "red"
AND y.GCC IS NULL

E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Nosediver
Starting Member

7 Posts

Posted - 2007-10-08 : 23:56:54
Thanks for your answer, but I am still having problems implementing it. So far I only found missing brackets. But I still get the message: syntax error (missing operator) in query expression ".
This is my current code:

SELECT f.[4DigitGCC], f.SupplierCapabilitySEA, x.Name, x.Rating, x.Criteria
FROM ([4x4] AS f
INNER JOIN ASDBComplete As x ON x.GCC = f.[4DigitGCC])
LEFT JOIN ASDBComplete AS y ON y.GCC = f.[4DigitGCC]
AND y.Rating IN ("green", "yellow")
WHERE (x.Rating = "red"
AND y.GCC IS NULL)
Go to Top of Page

ColinD
Starting Member

40 Posts

Posted - 2007-10-18 : 06:48:51
Try:

SELECT f.[4DigitGCC], f.SupplierCapabilitySEA, x.Name, x.Rating, x.Criteria
FROM [4x4] AS f
INNER JOIN ASDBComplete As x ON x.GCC = f.[4DigitGCC]
LEFT JOIN ASDBComplete AS y ON y.GCC = f.[4DigitGCC]
AND y.Rating IN ("green", "yellow")
WHERE (x.Rating = "red"
AND y.GCC IS NULL)
Go to Top of Page
   

- Advertisement -