0
SSRSレポートを作成しており、データセットクエリのヘルプが必要です。私は希望のデータを得るためにクエリを書く方法がわかりません。SQL Server for SSRSのクエリ
クエリー1:
SELECT DISTINCT FullDate,
SUM([Gross]) AS Gross
,StoreName
FROM [T1] inner join [T2]
on T1.StoreKey = T2.StoreKey
inner join T3
on T1.DateKey = T3.DateKey
where [Store] = 'B'
and FullDate = '2016-10-24'
group by FullDate,
StoreName
このため結果は:
FullDate Gross StoreName
2016-10-24 2621.89 B
QUERY2:
SELECT DISTINCT FullDate,SUM(TotalCost) AS TotalCost,
SUM([Gross]) AS Gross
,StoreName
FROM [T1] inner join [T2]
on T1.StoreKey = T2.Storekey
inner join T3
on T1.DateKey = T3.DateKey
inner join T4
on T1.DateKey = T4.DateKey
and T1.StoreKey = T4.StoreKey
where [Store] = 'B'
and FullDate = '2016-10-24'
group by FullDate,
StoreName
このため結果は:
FullDate TotalCost Gross StoreName
2016-10-24 5 20060.12 B
私はSSRSの1つのテーブルでそれを使用できるように、query2で2621.89を達成したいと思います。