MCTampa
Board Regular
- Joined
- Apr 14, 2016
- Messages
- 97
I have the following SQL statement, which works correctly
However all I want to do is include the fields ab.SW and ab.EW in my result, but I'm unsure how or where to add them.
I've tried simply adding a Group By line, but it does not accept anything from ab.
The board helped me create the query and I've modified it a few times, but I have not had a necessity for adding these elements as of yet.
SQL:
SELECT
OA.RAREA,
OA.RCODE,
OA.RGNAME,
OA.RRATCD,
OA.Size,
OA.StartWeek,
OA.EndWeek
FROM [Automatics with Ranges] AS OA
WHERE (((Exists (SELECT*
FROM [SSG Exclusion List] ab
Where ab.RESX = OA.[RCODE]
AND OA.Size = ab.Size
AND OA.[StartWeek] <= ab.SW
AND OA.[EndWeek]>= ab.EW
))<>False));
However all I want to do is include the fields ab.SW and ab.EW in my result, but I'm unsure how or where to add them.
I've tried simply adding a Group By line, but it does not accept anything from ab.
The board helped me create the query and I've modified it a few times, but I have not had a necessity for adding these elements as of yet.
Last edited: