ms access - Group by with UNION -
My code is not properly grouped, it still does not have a group with [Reden uitstroom2] and [Reden uitstroom3] [Reden uitstroom1]]. Counting works properly, but [Reden Uitstroom1]
For example, duplicate your performance:.
Reden uitstroom1 = 1x A / 2x B
Reden uitstroom2 = 1x A / B 1x
Unset Uitstroom 2014 - Reden Uitstroom1
1 - A1 1A - 2 BB1 - B
which should be: [Reden>
select count (Hertoetsing. [Reden uitstroom1]) as, [Aantal Uitstroom 2014] in (Hertoetsing. [Reden uitstroom1]) Join Klantinformatie interiors from [Reden uitstroom1] as Klantinformatie.KlantID = Hertoetsing.Klantid on Hertoetsing Where (((year (Hertoetsing. [Datum uitstroom1]) = 2014) Group by Hertoetsing. [Reden uitstroom1] UNION SELECT ALL COUNT (Hertoetsing. [Reden uitstroom2]) as [Aantal Uitstroom 2014], (Hertoetsing. [Reden uitstroom2]) as [Reden Uitstroom1] from Klantinformatie Join Klantinformatie inner Hertoetsing .KlantID = Hertoetsing.Klantid ou (((Year (Hertoetsing. [Datum uitstroom2]))) 2014) Group by Hertoetsing. [Reden uitstroom2] Select UNION ALL COUNT (Hertoetsing. [Reden uitstroom3]) as [Aantal Uitstroom 2014], (Hertoetsing. [Reden uitstroom3]) as [Reden Uitstroom1] from Klantinformatie INNER Klantinformatie.KlantID = Hertoetsing .Klantid Join at WHERE () ((year (Hertoetsing. [Figures uitstroom3]) = 2014) Group by Hertoetsing. [Reden uitstroom3];
You have to wrap the query in another SELECT
ie
add ([Aantal Uitstroom 2014] [Aantal Uitstroom) as the selection of 2014], [Reden Uitstroom] from ([UNION query here is]) Group by [Reden Uitstroom ]
without SELECT
casing, it is doing all that combine the results of count
of each individual because there is no equation Or the group is not applicable.
Comments
Post a Comment