Compare commits
4 Commits
0581aba919
...
301a7bff2a
| Author | SHA1 | Date | |
|---|---|---|---|
| 301a7bff2a | |||
| 7431a845ce | |||
| bfd18b5154 | |||
| 04d9e8f45b |
@@ -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];"
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user