M
msmuzila
Can anyone please help me, i need to rewrite this sql query in vb so i
use it as a rowsource for a listbox. I need to do it this way because i
dont want to create a lot of querys.
SELECT Year([SHIP_DATE]) AS [Year], Sum(Invoices.TOTAL) AS Sales
FROM Invoices
WHERE (((Year([SHIP_DATE]))>Year(Now())-6) AND
((Invoices.FINALIZED)=True) AND
((Invoices.CODE)<>[forms]![Sale_Monthly]![N1] And
(Invoices.CODE)<>[forms]![Sale_Monthly]![N2] And
(Invoices.CODE)<>[forms]![Sale_Monthly]![N3]))
GROUP BY Year([SHIP_DATE]);
Thanks
Matt
use it as a rowsource for a listbox. I need to do it this way because i
dont want to create a lot of querys.
SELECT Year([SHIP_DATE]) AS [Year], Sum(Invoices.TOTAL) AS Sales
FROM Invoices
WHERE (((Year([SHIP_DATE]))>Year(Now())-6) AND
((Invoices.FINALIZED)=True) AND
((Invoices.CODE)<>[forms]![Sale_Monthly]![N1] And
(Invoices.CODE)<>[forms]![Sale_Monthly]![N2] And
(Invoices.CODE)<>[forms]![Sale_Monthly]![N3]))
GROUP BY Year([SHIP_DATE]);
Thanks
Matt