T
Tim
Hi everyone,
I need a help on my query. Here is what I want to do:
If the (salesIDs are A or C) and the sum of Amount is
greater than 50, then the sales person get $1.5 from the
invoice otherwise get $1.
I have a query like this but it doesn't work. Could
anyone tell me how to fix it?
SELECT Sales.Invoice, IIf([SalesID]=("A" Or "C") And Sum
([Amount])>5000,1.5,1) AS Com, Sales.date
FROM Sales
GROUP BY Sales.Invoice, Sales.date
HAVING (((Sales.date) Between #8/1/2003# And #8/31/2003#));
Sales Table:
Invoice SalesID Amount date
1 a 100 8/15/03
2 a 10 8/1/03
3 b 15 8/30/03
4 c 51 7/31/03
Thanks in advaince.
Tim.
I need a help on my query. Here is what I want to do:
If the (salesIDs are A or C) and the sum of Amount is
greater than 50, then the sales person get $1.5 from the
invoice otherwise get $1.
I have a query like this but it doesn't work. Could
anyone tell me how to fix it?
SELECT Sales.Invoice, IIf([SalesID]=("A" Or "C") And Sum
([Amount])>5000,1.5,1) AS Com, Sales.date
FROM Sales
GROUP BY Sales.Invoice, Sales.date
HAVING (((Sales.date) Between #8/1/2003# And #8/31/2003#));
Sales Table:
Invoice SalesID Amount date
1 a 100 8/15/03
2 a 10 8/1/03
3 b 15 8/30/03
4 c 51 7/31/03
Thanks in advaince.
Tim.