SQL Kasa Raporu

[2 Gün Kasa Durumu:1, 2:0]
>[D]Gün|[C]Toplam
{REPORT SQL DETAILS:SET LANGUAGE Turkish SELECT DATENAME(dw, Payments.[Date]) as 'Gün',SUM(Payments.Amount)-CASE WHEN SUM(ChangePayments.Amount) > 0 THEN SUM(ChangePayments.Amount) ELSE '0' END as 'Toplam' FROM Payments LEFT JOIN ChangePayments ON Payments.TicketId = ChangePayments.TicketId WHERE Payments.Date BETWEEN CONVERT(DATE,DATEADD(YEAR, 0 , getdate()-1)) AND CONVERT(DATE,DATEADD(YEAR, 0 , getdate()+1)) GROUP BY DAY(Payments.Date),DATENAME(dw, Payments.[Date]) ORDER BY DAY(Payments.[Date]) ASC:F.Gün,M([F.Toplam])}
>Toplam |{REPORT SQL DETAILS:SET LANGUAGE Turkish SELECT SUM(Payments.Amount)-CASE WHEN SUM(ChangePayments.Amount) > 0 THEN SUM(ChangePayments.Amount) ELSE '0' END as 'Toplam' FROM Payments LEFT JOIN ChangePayments ON Payments.TicketId = ChangePayments.TicketId WHERE Payments.Date BETWEEN CONVERT(DATE,DATEADD(YEAR, 0 , getdate()-1)) AND CONVERT(DATE,DATEADD(YEAR, 0 , getdate()+1)):M([F.Toplam])}

[Bu Hafta Kasa Durumu:1, 2:0]
>[D]Gün|[C]Toplam
{REPORT SQL DETAILS:SET LANGUAGE Turkish SELECT DATENAME(dw, Payments.[Date]) as 'Gün', SUM(Payments.Amount)-CASE WHEN SUM(ChangePayments.Amount) > 0 THEN SUM(ChangePayments.Amount) ELSE '0' END as 'Toplam' FROM Payments LEFT JOIN ChangePayments ON Payments.TicketId = ChangePayments.TicketId WHERE Payments.Date BETWEEN DATEADD(ww, DATEDIFF(ww, 0, getdate()), 0 ) AND DATEADD(ww, DATEDIFF(ww, 0, getdate()), 7 ) GROUP BY DAY(Payments.Date),DATENAME(dw, Payments.[Date]) ORDER BY DAY(Payments.[Date]) ASC:F.Gün,M([F.Toplam])}
>Toplam |{REPORT SQL DETAILS:SET LANGUAGE Turkish SELECT SUM(Payments.Amount)-CASE WHEN SUM(ChangePayments.Amount) > 0 THEN SUM(ChangePayments.Amount) ELSE '0' END as 'Toplam' FROM Payments LEFT JOIN ChangePayments ON Payments.TicketId = ChangePayments.TicketId WHERE Payments.Date BETWEEN DATEADD(ww, DATEDIFF(ww, 0, getdate()), 0 ) AND DATEADD(ww, DATEDIFF(ww, 0, getdate()), 7 ):M([F.Toplam])}

[Geçen Hafta Kasa Durumu:1, 2:0]
>[D]Gün|[C]Toplam
{REPORT SQL DETAILS:SET LANGUAGE Turkish SELECT DATENAME(dw, Payments.[Date]) as 'Gün', SUM(Payments.Amount)-CASE WHEN SUM(ChangePayments.Amount) > 0 THEN SUM(ChangePayments.Amount) ELSE '0' END as 'Toplam' FROM Payments LEFT JOIN ChangePayments ON Payments.TicketId = ChangePayments.TicketId WHERE Payments.Date BETWEEN DATEADD(ww, DATEDIFF(ww, 0, getdate()) -1, 0 ) AND DATEADD(ww, DATEDIFF(ww, 0, getdate()) -1, 7 ) GROUP BY DAY(Payments.Date),DATENAME(dw, Payments.[Date]) ORDER BY DAY(Payments.[Date]) ASC:F.Gün,M([F.Toplam])}
>Toplam   |{REPORT SQL DETAILS:SET LANGUAGE Turkish SELECT SUM(Payments.Amount)-CASE WHEN SUM(ChangePayments.Amount) > 0 THEN SUM(ChangePayments.Amount) ELSE '0' END as 'Toplam' FROM Payments LEFT JOIN ChangePayments ON Payments.TicketId = ChangePayments.TicketId WHERE Payments.Date BETWEEN DATEADD(ww, DATEDIFF(ww, 0, getdate()) -1, 0 ) AND DATEADD(ww, DATEDIFF(ww, 0, getdate()) -1, 7 ):M([F.Toplam])}

[Bu Ay Kasa Durumu:1,5, 2:0]
>[D]Gün|[D]Gün Ad|[C]Toplam
{REPORT SQL DETAILS:SET LANGUAGE Turkish SELECT  DAY(Payments.[Date]) as Gün, DATENAME(dw, Payments.[Date]) as Ad, SUM(Payments.Amount)-CASE WHEN SUM(ChangePayments.Amount) > 0 THEN SUM(ChangePayments.Amount) ELSE '0' END as 'Toplam' FROM Payments LEFT JOIN ChangePayments ON Payments.TicketId = ChangePayments.TicketId WHERE Payments.[Date] IS NOT NULL AND MONTH(Payments.[Date]) = MONTH(GETDATE())  GROUP BY DAY(Payments.Date),DATENAME(dw, Payments.[Date]) ORDER BY DAY(Payments.[Date]) ASC:F.Gün,F.Ad,M([F.Toplam])}
>Toplam||{REPORT SQL DETAILS:SET LANGUAGE Turkish SELECT SUM(Payments.Amount)-CASE WHEN SUM(ChangePayments.Amount) > 0 THEN SUM(ChangePayments.Amount) ELSE '0' END as 'Toplam' FROM Payments LEFT JOIN ChangePayments ON Payments.TicketId = ChangePayments.TicketId WHERE Payments.[Date] IS NOT NULL AND MONTH(Payments.[Date]) = MONTH(GETDATE()):M([F.Toplam])}

[Geçen Ay Kasa Durumu:1,5, 2:0]
>[D]Gün|[D]Gün Ad|[C]Toplam
{REPORT SQL DETAILS:SET LANGUAGE Turkish SELECT  DAY(Payments.[Date]) as Gün, DATENAME(dw, Payments.[Date]) as Ad, SUM(Payments.Amount)-CASE WHEN SUM(ChangePayments.Amount) > 0 THEN SUM(ChangePayments.Amount) ELSE '0' END as 'Toplam' FROM Payments LEFT JOIN ChangePayments ON Payments.TicketId = ChangePayments.TicketId WHERE Payments.[Date] IS NOT NULL AND Payments.[Date] BETWEEN DATEADD(mm, DATEDIFF(mm, 0, getdate()) -1,0) AND DATEADD(mm, DATEDIFF(mm, 0, getdate()),0) GROUP BY DAY(Payments.Date),DATENAME(dw, Payments.[Date]) ORDER BY DAY(Payments.[Date]) ASC:F.Gün,F.Ad,M([F.Toplam])}
>Toplam||{REPORT SQL DETAILS:SET LANGUAGE Turkish SELECT SUM(Payments.Amount)-CASE WHEN SUM(ChangePayments.Amount) > 0 THEN SUM(ChangePayments.Amount) ELSE '0' END as 'Toplam' FROM Payments LEFT JOIN ChangePayments ON Payments.TicketId = ChangePayments.TicketId WHERE Payments.[Date] IS NOT NULL AND Payments.[Date] BETWEEN DATEADD(mm, DATEDIFF(mm, 0, getdate()) -1,0) AND DATEADD(mm, DATEDIFF(mm, 0, getdate()),0) :M([F.Toplam])}

2 Beğeni

Teşekkürler İlyas Bey…

İlyas bey siz olmazsanız buralar ısız ada gibi keşke benimde teknik bilgim olsa da sizin gibi katkım sunabileyim.

1 Beğeni

Bu konu son yanıttan 30 gün sonra otomatik olarak kapatıldı. Yeni yanıtlara artık izin verilmiyor.