Compare commits

..

4 Commits

2 changed files with 9 additions and 15 deletions

View File

@@ -3418,27 +3418,21 @@ Module Mail
' --- SQL 1x laden: alle Monate / Datenquellen ---
Dim sqlstr As String =
"SELECT * FROM (
SELECT
COUNT(*) AS Anzahl,
'IDS' AS Datenquelle,
MONTH(t.YearMonthDay) AS [Month],
YEAR(t.YearMonthDay) AS [Year]
FROM tblIDSTransactionsNew t
INNER JOIN tbl_IDS_Länder l ON t.OutletCountryCode = l.OutletCountryCode
INNER JOIN tbl_IDS_Produkte p ON t.ProductTypeCode = p.ProductTypeCode
WHERE YEAR(t.YearMonthDay) = " & yearVal & "
GROUP BY MONTH(t.YearMonthDay), YEAR(t.YearMonthDay)
SELECT count(*) as Anzahl, 'IDS' as Datenquelle, Month(tblIDSTransactionsNew_details.YearMonthDay) as Month,Year(tblIDSTransactionsNew_details.YearMonthDay) as Year
FROM tblIDSTransactionsNew_details
WHERE Year(tblIDSTransactionsNew_details.YearMonthDay) = " & yearVal & "
GROUP BY Month(tblIDSTransactionsNew_details.YearMonthDay),Year(tblIDSTransactionsNew_details.YearMonthDay)
UNION ALL
SELECT
COUNT(*) AS Anzahl,
Datenquelle,
MONTH([Transaction date]) AS [Month],
YEAR([Transaction date]) AS [Year]
MONTH(Billingdate) AS [Month],
YEAR(Billingdate) AS [Year]
FROM [VERAG].[dbo].[tblMautbericht]
WHERE YEAR([Transaction date]) = " & yearVal & "
GROUP BY Datenquelle, MONTH([Transaction date]), YEAR([Transaction date])
WHERE YEAR(Billingdate) = " & yearVal & " and Datenquelle not in ('IDS')
GROUP BY Datenquelle, MONTH(Billingdate), YEAR(Billingdate)
) AS temp
ORDER BY Datenquelle, temp.[Year], temp.[Month];"