sql - Query showing ID instead of description -


It works fine until I start using union all!
Here is the use of classified because I do not have permission to share too much information

This radian must show the utstrom and not the id. I really do not have a clue why this happens ...

look-up table =

  ID Description 1 classified 2 classifieds 3 classified 4 graded 5 6 Classifieds 7 classified 8 Classifieds 9 categories < / Code> 

Code =

  Select Count (Hertoetsing [Reden uitstroom1]) as [Aantal Uitstroom 2014], (Hertoetsing. [Reden uitstroom1]) as [Reden Uitstroom] from Klantinformatie where Klantinformatie.KlantID = Hertoetsing.Klantid on Hertoetsing Join Insider (((Year (Hertoetsing . [Datum uitstroom1])) =) Group by Hertoetsing. [Reden uitstroom1] Do UNION select all count (Hertoetsing. [Reden uitstroom2]) as [Aantal Uitstroom 2014], (Hertoetsing. [Reden uitstroom2]) as [Reden Uitstroom] Klantinformatie Join within Klantinformatie Hertoetsing .KlantID = Harotosing Clintid WHERE ((((Years ertoetsing. [Datum uitstroom2]))) Group by Hertoetsing. [Reden uitstroom2] UNION Klantinformatie.KlantID all Select Klantinformatie the count (Hertoetsing. [Reden uitstroom3]) as [Aantal Uitstroom 2014], (Hertoetsing. [Reden uitstroom3]) as [Reden Uitstroom] Insider = Hertoetsing.Klantid Join Hertoetsing Where (((Year (Hertoetsing [Datum uitstroom3])) 2014) Group by Hertoetsing [Reden uitstroom3].  

Results =

  Aantal Uitstroom 2014 Reden Uitstroom 27 1 25 2 46 3 1 4 3 5 9 6 17 8 3 9 4 1 2 2 5 3 1 4 1 6 1 1 2 1 3 2 8  

Correct the group =

 < select the code> sum ([Aantal Uitstroom 2014]) as [Uitstroom 2014], [Reden Uitstroom] as [Uitstroom] from [Reden group Uitstroom1 2014] [Reden Uitstroom];  

Results =

  Uitstroom 2014 Uitstroom 32 1 28 2 52 3 2 4 3 5 10 6 19 8 3 9 < / Code> 

Edit - Another issue with another query =

The query runs properly, but once I get it in a report If you put it off, instead of showing the ID from the look-up table .... it is very strange ....


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -