union query with "unique" and "is not null" values

  • Thread starter Thread starter Mark Kubicki
  • Start date Start date
M

Mark Kubicki

how do I add to the properties of a Union Query a limit for all the vaules
to be UNIQUE and "IS NOT NULL";

easy to do with the simple query, but I am totally lost in my Union Query
attempts.

as always, thanks in advance,
mark

SELECT [QuoteSource]
FROM [FixtureTypesNoProject]

UNION SELECT [QuoteSource]
FROM [FixtureCatalogueCostHistory]
ORDER BY [QuoteSource];
 
Mark said:
how do I add to the properties of a Union Query a limit for all the vaules
to be UNIQUE and "IS NOT NULL";

easy to do with the simple query, but I am totally lost in my Union Query
attempts.

as always, thanks in advance,
mark

SELECT [QuoteSource]
FROM [FixtureTypesNoProject]

UNION SELECT [QuoteSource]
FROM [FixtureCatalogueCostHistory]
ORDER BY [QuoteSource];


Add a WHERE clause ro each select query to deal with the
Null issue

SELECT [QuoteSource]
FROM [FixtureTypesNoProject]
WHERE QuoteSource Is Not Null

UNION

SELECT [QuoteSource]
FROM [FixtureCatalogueCostHistory]
WHERE QuoteSource Is Not Null

ORDER BY [QuoteSource];

Using UNION instead if UNION ALL is sufficient to limit the
results to distinct records.
 
Back
Top