# Day by Day Sales Report

**URL:** <https://forum.sambapos.com/t/day-by-day-sales-report/2603>\
**Category:** V4 Custom Reports\
**Created:** [September 15, 2014, 10:52am UTC](https://forum.sambapos.com/t/day-by-day-sales-report/2603 "2014-09-15T10:52:12Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![gerlandog](https://forum.sambapos.com/user_avatar/forum.sambapos.com/gerlandog/32/39076_2.png) [@gerlandog](https://forum.sambapos.com/u/gerlandog)\
**Post date:** [September 15, 2014, 10:52am UTC](https://forum.sambapos.com/t/day-by-day-sales-report/2603/1 "2014-09-15T10:52:12Z")

</div>

I usually like to compare day sales between weeks or even months, lets say second saturday of every month… or all saturdays in a month…

that why I use this report… hope this is usefull!!!

Report:

```
[Ventas Dia a Dia:2,1, 1, 1, 1, 1]
>Fecha|Dia|Neto|Taxa|Desc|Total
@@VentasDiarias
>TOTAL||@@TotalVentasDiarias

```

SQL:

```
@@VentasDiarias:
SELECT 
  convert(nvarchar,T.Date,103) as Fecha,  
  min(datename(dw,Date)) as Dia,
  FORMAT(ISNULL(SUM(T.TotalAmount)-SUM(Cal.CalculationAmount),0),'C') as NetoTicket,
  FORMAT(SUM(case 
      when Cal.CalculationTypeId = 4 then Cal.CalculationAmount
	  else 0 end),'C') as Taxa,
  FORMAT(SUM(case 
      when Cal.CalculationTypeId = 1 then Cal.CalculationAmount 
	  else 0 end),'C') as Desconto,
  FORMAT(SUM(T.TotalAmount),'C') as TotalTicket

FROM Tickets AS T

LEFT OUTER JOIN Calculations as Cal on Cal.TicketId = T.Id

WHERE Date > '{Start}' AND Date < '{End}'

GROUP BY convert(nvarchar,T.Date,103)

ORDER BY min(T.Date)

```

and

```
@@TotalVentasDiarias:
SELECT 
  FORMAT(ISNULL(SUM(T.TotalAmount)-SUM(Cal.CalculationAmount),0),'C') as NetoTicket,
  FORMAT(SUM(case 
      when Cal.CalculationTypeId = 4 then Cal.CalculationAmount
	  else 0 end),'C') as Taxa,
  FORMAT(SUM(case 
      when Cal.CalculationTypeId = 1 then Cal.CalculationAmount 
	  else 0 end),'C') as Desconto,
  FORMAT(SUM(T.TotalAmount),'C') as TotalTicket

FROM Tickets AS T

LEFT OUTER JOIN Calculations as Cal on Cal.TicketId = T.Id

WHERE Date > '{Start}' AND Date < '{End}'

```

G.

---

_[View the full topic](https://forum.sambapos.com/t/day-by-day-sales-report/2603)._
