SELECT Dias.Dia, Cartao.Total, Dinheiro.Total, Deposito.Total, Cheques.Total, ChequeDev.Total
    FROM ((((((select 1 as Dia from empresa
    union all (select 2 as Dia from empresa)
    union all (select 3 as Dia from empresa)
    union all (select 4 as Dia from empresa)
    union all (select 5 as Dia from empresa)
    union all (select 6 as Dia from empresa)
    union all (select 7 as Dia from empresa)
    union all (select 8 as Dia from empresa)
    union all (select 9 as Dia from empresa)
    union all (select 10 as Dia from empresa)
    union all (select 11 as Dia from empresa)
    union all (select 12 as Dia from empresa)
    union all (select 13 as Dia from empresa)
    union all (select 14 as Dia from empresa)
    union all (select 15 as Dia from empresa)
    union all (select 16 as Dia from empresa)
    union all (select 17 as Dia from empresa)
    union all (select 18 as Dia from empresa)
    union all (select 19 as Dia from empresa)
    union all (select 20 as Dia from empresa)
    union all (select 21 as Dia from empresa)
    union all (select 22 as Dia from empresa)
    union all (select 23 as Dia from empresa)
    union all (select 24 as Dia from empresa)
    union all (select 25 as Dia from empresa)
    union all (select 26 as Dia from empresa)
    union all (select 27 as Dia from empresa)
    union all (select 28 as Dia from empresa)
    union all (select 29 as Dia from empresa)
    union all (select 30 as Dia from empresa)
    union all (select 31 as Dia from empresa) ) AS Dias 
    LEFT JOIN 
    (SELECT (date(contasreceber.Data)) AS Dia, Sum(contasreceber.Valor) AS Total
	    FROM contasreceber
	    GROUP BY Data, contasreceber.Data, tipo, contasreceber.Vendedor
	    HAVING (((contasreceber.Data) Between '2009-06-01' And '2023-06-20') AND ((Left('tipo',6))='Cartão') AND ((contasreceber.Vendedor)=1))
	    ORDER BY contasreceber.Data, Left('tipo',6) ) AS Cartao ON Dias.Dia = Cartao.Dia)
	LEFT JOIN 
	(SELECT (date(contasreceber.Data)) AS Dia, Sum(contasreceber.Valor) AS Total
        FROM contasreceber
        GROUP BY date(contasreceber.Data), contasreceber.Data, contasreceber.Tipo, contasreceber.Vendedor
        HAVING (((contasreceber.Data) Between '2009-06-01' And '2023-06-20') AND ((contasreceber.Tipo)='Dinheiro') AND ((contasreceber.Vendedor)=1))
        ORDER BY contasreceber.Data, contasreceber.Tipo)  AS Dinheiro ON Dias.Dia = Dinheiro.Dia)
    LEFT JOIN 
    (SELECT (date(contasreceber.Data)) AS Dia, Sum(contasreceber.Valor) AS Total
        FROM contasreceber
        GROUP BY date(contasreceber.Data), contasreceber.Data, Left('tipo',3), contasreceber.Vendedor
        HAVING (((contasreceber.Data) Between '2009-06-01' And '2023-06-20') AND ((Left('tipo',3))='Dep') AND ((contasreceber.Vendedor)=1))
        ORDER BY contasreceber.Data, Left('tipo',3))  AS Deposito ON Dias.Dia = Deposito.Dia)
       -- ---
    LEFT JOIN
    (SELECT Dia, SUM(TotalCheques) as Total
	    FROM
		(SELECT (date(cheques.data)) AS Dia, SUM(cheques.Valor) AS TotalCheques
		FROM cheques
		LEFT JOIN contasreceber ON cheques.MKPag = contasreceber.MK
			GROUP BY Dia, cheques.Data, contasreceber.Vendedor, cheques.MKPag
			HAVING (date(cheques.Data) Between '2009-06-01' And '2023-06-20') AND ((cheques.MKPag) Is Not Null And (cheques.MKPag)<>0 AND (contasreceber.Vendedor)=1)
			ORDER BY date(cheques.Data)) AS T1
			GROUP BY Dia) AS Cheques ON Dias.Dia = Cheques.Dia) 
		-- ---
	LEFT JOIN 
	(SELECT Dia, SUM(TotalCheques) AS Total
	FROM (
		SELECT (date(cheques.DataDevolucao)) AS Dia, Sum(cheques.Valor) AS TotalCheques
		FROM cheques
		LEFT JOIN contasreceber ON cheques.MKPag=contasreceber.MK
			GROUP BY date(cheques.DataDevolucao), cheques.DataDevolucao, cheques.MKPag, contasreceber.Vendedor
			HAVING (((cheques.DataDevolucao) Between '2009-06-01' And '2023-06-20') AND ((cheques.MKPag) Is Not Null And (cheques.MKPag)<>0) AND ((contasreceber.Vendedor)=1))
			ORDER BY cheques.DataDevolucao) AS T2
			GROUP BY dia) AS ChequeDev ON Dias.Dia = ChequeDev.Dia);