O
Oh Carla...
I have a simple union query:
SELECT
Sum([Engr MH]) AS MECHENGRMH,
0 AS MISCENGRMH,
Sum([YardsConcrete]) AS MECHCONCRT,
0 AS MISCCONCRT,
From [qryComponentParts]
WHERE ((([qryComponentParts].[Miscellaneous])=0))
UNION SELECT
0 AS MECHENGRMH,
Sum([Engr MH]) AS MISCENGRMH,
0 AS MECHCONCRT,
Sum([YardsConcrete]) AS MISCCONCRT,
From [qryComponentParts]
WHERE ((qryComponentParts.Miscellaneous)=-1);
It works just fine when I have items that are equal (three
items where miscellaneous is equal to 0, two items where
miscellaneous equal to -1). The first line will be those
items equal to 0 and the second line will be those items
equal to -1.
The problem comes when one of the two sets is null. For
example, if I have no miscellaneous that is equal to -1 (a
null set), that line becomes the first line of the result
instead of the second. Any reason behind that?
SELECT
Sum([Engr MH]) AS MECHENGRMH,
0 AS MISCENGRMH,
Sum([YardsConcrete]) AS MECHCONCRT,
0 AS MISCCONCRT,
From [qryComponentParts]
WHERE ((([qryComponentParts].[Miscellaneous])=0))
UNION SELECT
0 AS MECHENGRMH,
Sum([Engr MH]) AS MISCENGRMH,
0 AS MECHCONCRT,
Sum([YardsConcrete]) AS MISCCONCRT,
From [qryComponentParts]
WHERE ((qryComponentParts.Miscellaneous)=-1);
It works just fine when I have items that are equal (three
items where miscellaneous is equal to 0, two items where
miscellaneous equal to -1). The first line will be those
items equal to 0 and the second line will be those items
equal to -1.
The problem comes when one of the two sets is null. For
example, if I have no miscellaneous that is equal to -1 (a
null set), that line becomes the first line of the result
instead of the second. Any reason behind that?