K
KenNiuM
how do i actually do a sum of a group by?
My SQL look something like this...
SELECT CashierLoginDetails.lStaffID, Last(CashierLoginDetails.[lDate/TIme])
AS [lDate/TImeOfLast], Last(CashierLoginDetails.lCashRegister) AS
lCashRegisterOfLast, SalesTransaction.stPaymentMode
FROM CashierLoginDetails, SalesTransaction
GROUP BY CashierLoginDetails.lStaffID, SalesTransaction.stPaymentMode;
I wan the last log in of the cashier. It would than show which cashRegister
i logged in at.
From the next table, i hope to capture the different payment mode, only
"NETS" and "CASH". I want to be able to sum up the total amount in the NETS
and CASH group.
This is how it looks like now..
http://i106.photobucket.com/albums/m268/KenNiuM/Untitled.jpg
The field with all the transaction amounts is stTotalAmount.
I want to sum up the amount in the table according to staffID, last time
till current, and payment mode.
Please help... i tried adding the field in the query and sum it, it doesn't
work..
My SQL look something like this...
SELECT CashierLoginDetails.lStaffID, Last(CashierLoginDetails.[lDate/TIme])
AS [lDate/TImeOfLast], Last(CashierLoginDetails.lCashRegister) AS
lCashRegisterOfLast, SalesTransaction.stPaymentMode
FROM CashierLoginDetails, SalesTransaction
GROUP BY CashierLoginDetails.lStaffID, SalesTransaction.stPaymentMode;
I wan the last log in of the cashier. It would than show which cashRegister
i logged in at.
From the next table, i hope to capture the different payment mode, only
"NETS" and "CASH". I want to be able to sum up the total amount in the NETS
and CASH group.
This is how it looks like now..
http://i106.photobucket.com/albums/m268/KenNiuM/Untitled.jpg
The field with all the transaction amounts is stTotalAmount.
I want to sum up the amount in the table according to staffID, last time
till current, and payment mode.
Please help... i tried adding the field in the query and sum it, it doesn't
work..