From: jo on
I have two tables say A and B, what I am trying to achieve with the query is
just to display records that have the received field ticked in table A and
the colour field in table B not containing �Y�.

How do I modify the code below to achieve this?

SELECT A_Date, A.Received, A.ID, B. Colour
FROM A LEFT JOIN B
ON DDP_A.Main = B.Main
WHERE (((A.Received)= -1) AND ((B.Colour <> �Y�));
From: Marshall Barton on
jo(a)jo.uk wrote:

>I have two tables say A and B, what I am trying to achieve with the query is
>just to display records that have the received field ticked in table A and
>the colour field in table B not containing �Y�.
>
>How do I modify the code below to achieve this?
>
>SELECT A_Date, A.Received, A.ID, B. Colour
>FROM A LEFT JOIN B
> ON DDP_A.Main = B.Main
>WHERE (((A.Received)= -1) AND ((B.Colour <> �Y�));


Did you Copy/Paste that query or retype it?

It looks like it would do what you asked if you fixed the
bad table and field names and the unbalanced Parenthesis.

Maybe the Join should be INNER JOIN so you know there sould
be a B.Color value to check.

--
Marsh
MVP [MS Access]
From: jo on
The code was just to demonstrate what I had in mind.

I have updated the example regarding bad table and field names. Could you
help with the unbalanced Parenthesis?

SELECT A.Date, A.Received, A.ID, B. Colour
FROM A inner JOIN B
ON A.Main = B.Main
WHERE (((A.Received)= -1) AND ((B.Colour <> "Y"));
From: KARL DEWEY on
For every open you gotta have a close. Try this --
SELECT A.Date, A.Received, A.ID, B. Colour
FROM A inner JOIN B ON A.Main = B.Main
WHERE (A.Received= -1) AND (B.Colour <> "Y");

--
Build a little, test a little.


"jo(a)jo.uk" wrote:

> The code was just to demonstrate what I had in mind.
>
> I have updated the example regarding bad table and field names. Could you
> help with the unbalanced Parenthesis?
>
> SELECT A.Date, A.Received, A.ID, B. Colour
> FROM A inner JOIN B
> ON A.Main = B.Main
> WHERE (((A.Received)= -1) AND ((B.Colour <> "Y"));
> .
>
From: Marshall Barton on
jo(a)jo.uk wrote:

>The code was just to demonstrate what I had in mind.
>
>I have updated the example regarding bad table and field names. Could you
>help with the unbalanced Parenthesis?
>
>SELECT A.Date, A.Received, A.ID, B. Colour
>FROM A inner JOIN B
> ON A.Main = B.Main
>WHERE (((A.Received)= -1) AND ((B.Colour <> "Y"));


Access's over enthusastic use of parenthesis might have
confused you. There should have been a ) just before the
semicolon. But, in this case, none of them are needed so
you can just remove all of them.

--
Marsh
MVP [MS Access]