Quantcast
Channel: SCN : Unanswered Discussions - Reporting and Printing
Viewing all articles
Browse latest Browse all 776

prefilter Pivottable with where clause

$
0
0

Declare @KUN NvarChar(5)  = /* SELECT FROM OCRD X2 WHERE X2.CardCode =*/ '[%0]' 


 

 

 

 

SELECT

 

 

CardCode, Cardname, Address, ZipCode, City, CntctPrsn, Mobiltelefon, Phone1, Info_aktuell, Kundeninfo,

"Produkt 1"

"Produkt 2"

"Produkt 3"

 

 

FROM

 

 

(SELECT T0.[CardCode], T0.[CardName], T0.[Address], T0.[ZipCode], T0.[City], T0.[CntctPrsn], T0.[Cellular] AS Mobiltelefon, T0.[Phone1], cast(T0.U_Info_aktuell as nvarchar(max)) AS Info_aktuell, cast(T0.U_Kundeninfo as nvarchar(max)) AS Kundeninfo, T2.[Quantity] as Menge, T2.[Dscription]

 

 

as Product FROM OCRD T0 full outer JOIN OINV T1 ON T0.CardCode = T1.CardCode full outer JOIN INV1 T2 ON T1.DocEntry = T2.DocEntry where

 

 

T0.[CardType] = 'C'

 

 

Union all

 

 

SELECT T0.[CardCode], T0.[CardName], T0.[Address], T0.[ZipCode], T0.[City], T0.[CntctPrsn], T0.[Cellular], T0.[Phone1], cast(T0.U_Info_aktuell as nvarchar(max)) AS Info_aktuell, cast(T0.U_Kundeninfo as nvarchar(max)) AS Kundeninfo, -T2.[Quantity] as Menge, T2.[Dscription]

 

 

as Product FROM OCRD T0 full outer JOIN ORIN T1 ON T0.CardCode = T1.CardCode full outer JOIN RIN1 T2 ON T1.DocEntry = T2.DocEntry where

 

 

T0.[CardType] = 'C')

 

 

AS Quellabfrage

 

 

PIVOT

 

 

(

 

 

Sum(Menge)

 

 

FOR

 

 

Product

 

 

IN (

"Produkt 1"

"Produkt 2"

"Produkt 3"

 

 

)

 

 

) AS PivotTable

 

I want to filter this pivot table by customer number. Unfortunately, it's not working. Who can help ?


Viewing all articles
Browse latest Browse all 776

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>