Witam, kolegów napisałem zestawienie
select
kh_Symbol as 'Kontrahent'
, case when dok_Podtyp = 5 then dok_DataWyst end as 'Data fakt. zal. KOŃCOWEJ'
, case when dok_Podtyp = 5 then dok_NrPelny end as 'Nr faktury zal. KOŃCOWEJ'
, case when dok_Podtyp = 5 then dok_WartBrutto end as 'Wart. brutto faktury zal. KOŃCOWEJ'
, case when dok_Podtyp = 4 then dok_DataWyst end as 'Data fakt. Zal. CZĄSTKOWEJ'
, case when dok_Podtyp = 4 then dok_NrPelny end as 'Nr faktury zal. CZĄSTKOWEJ'
, case when dok_Podtyp = 4 then dok_WartBrutto end as 'Wart. brutto faktury zal. CZĄSTKOWEJ'
from dok__Dokument
Join kh__kontrahent ON dok_PlatnikId = kh_id
where dok_typ=2 and dok_Podtyp in (4,5)
--and (dok_DataWyst BETWEEN {DR:data dokumentu: POPRZEDNI_MIESIAC})
order by kh_Symbol
i działa ale rozbija mi na 2 wiersze podsumowanie a ja chciałbym żeby fv zaliczkowe pokazywały się po jednej stronie a powiązane do tego dokumentu po 2. Jak można to uzyskać?