Hi all I use this query to get the sale of all the POS that I have on my DB, but now I want to know if there is a way to get the days where we dont get sales by ranges or get the specific dates where the sales were zero, I need is the dates and range of date where the sales is zero.
Usually I copy the result of the query to an Excel spreadsheet, create a pivot table and them manually check where I have empty cells and those are the days where I dont have sale for that POS.
Here the query
Select día,año,mes,
c2.Super
,c3.Forma
,c1.pos
,c3.Desc_Pos
,c2.country
,sum([Ventas_valor_local]) as Ventas_Valor_Local
,(case when UPPER(c2.country) in( 'EL SALVADOR','PANAMÁ') then sum([Ventas_valor_local])
else
sum([Ventas_valor_local] )/
(select TasaDeCambio from DBP.[Prodution].[tbl_TasaDeCambio]
where mes = MONTH(getdate())-1 and Año=year(getdate()) and country =c2.country) end
)as Ventas_Dollar
,SUM([Ventas_Unidades])as Ventas_Unidades
from Sales.[Prodution].[tbl_Raw_daily_Super] C1
left outer join dbP.[Prodution].[tbl_Cat_Super] C2 on c2.idCadena = c1.Cadena and c2.Holding = 'WM' and c1.country = c2.country
left outer join dbP.[Prodution].[tbl_Cat_Pos] c3 on c3.idCadena = c2.idCadena and c3.idPos = c1.Pos
where
Año=2016
group by día,año,mes,c2.Super,c1.pos,c3.Desc_Pos,c2.country,c3.Forma
order by día,año,mes,c2.Super,c1.pos,c3.Desc_Pos,c2.country,c3.Forma
I will appreaciat any advice