Question : combining sql

is there a way to combine these 3 sql into one sql statement:

SELECT tbl_FD.FstMfgNum
FROM tbl_FD
GROUP BY tbl_FD.FstMfgNum
ORDER BY tbl_FD.FstMfgNum;

SELECT [Tbl_FD Old].FstMfgNum
FROM [Tbl_FD Old]
GROUP BY [Tbl_FD Old].FstMfgNum
ORDER BY [Tbl_FD Old].FstMfgNum;

SELECT Query1.FstMfgNum, Query2.FstMfgNum
FROM Query1 LEFT JOIN Query2 ON Query1.FstMfgNum = Query2.FstMfgNum
WHERE (((Query2.FstMfgNum) Is Null));

Answer : combining sql

So your goal is . . . what? To get a list of FstMfgNum's from tbl_FD that aren't in Tbl_FD Old? Try this:

SELECT Distinct tbl_FD.FstMfgNum
FROM tbl_FD INNER JOIN [Tbl_FD Old]
ON tbl_FD.FstMfgNum = [Tbl_FD Old].FstMfgNum
WHERE [Tbl_FD Old].FstMfgNum Is Null;

The Distinct will automatically give only one of each and will also sort for you.

Hope that helps . . .

brewdog
Random Solutions  
 
programming4us programming4us