[Solved] Query Question
This is my current query:
The WHERE clause is causing a problem. Say a Client has 20 transactions in a fund. I want to get all those transactions that are before 1.jan 04, but that query just skips all that clients transactions in a fund, if just one of the transactions are over 1.jan 04. So if a client has 20 transactions in Fund 1, and 5 of those are 2 Feb 02, I want the Sum(Shares) of the 15 before 1.jan, but now its just dropping all 20.
Any ideas? All help is greatly appreciated!
This is my current query:
Code:
SELECT ClientID, FundID, Sum(Shares) AS SumShares
FROM Transactions
WHERE SalesID = 44 AND TradeDate < Format(#01/01/2004#,"mm/dd/yyyy")
GROUP BY ClientID, FundID;
The WHERE clause is causing a problem. Say a Client has 20 transactions in a fund. I want to get all those transactions that are before 1.jan 04, but that query just skips all that clients transactions in a fund, if just one of the transactions are over 1.jan 04. So if a client has 20 transactions in Fund 1, and 5 of those are 2 Feb 02, I want the Sum(Shares) of the 15 before 1.jan, but now its just dropping all 20.
Any ideas? All help is greatly appreciated!
Last edited: