Hello,
I'm trying to create a select sum query with multiple where's.
So far I have got:
Balance: (SELECT Sum([Credit]+[Debit]) from tblTransactions as t where t.TrDate<=tblTransactions.TrDate AND t.Debit<=tblTransactions.Debit)
This is designed to select "Credit" and "Debit" from the above records in ascending TrDate and Debit order. However, I want to extend this to include a third field called "Analysis Code"
But just adding another AND criteria does not work.
For example:
Balance: (SELECT Sum([Credit]+[Debit]) from tblTransactions as t where t.TrDate<=tblTransactions.TrDate AND t.Debit<=tblTransactions.Debit AND t.Analysis Code<=tblTransactions.Analysis Code)
Any suggestions how to add this third where?
Thanks for the help (I have no clue about VBA!)