sum creditors balance up to a specific date

anchamal

Registered User.
Local time
Today, 09:03
Joined
Mar 7, 2010
Messages
57
i need to create a query to find the balance of creditors with specific dates

example 1/1/17 up to 31/1/17

customer A 1/1/17 €20
2/1/17 €25
31/1/17 €25
01/02/17 €100

what was the balance till 31/01/2017 of customer A?

using offce 2016
 
you need to sum the credit and payments:


Select [CustomernNo], Sum(nz(creditField,0) - nz(paymentField,0)) As Balance From yourTable Where [TransactionDate] Between [date start] And [date end] Group By [CustomerNo];
 
If you are able to use Arn's code then you have larger issues than the one you have presented. Arn's code supposes you haven't structured your data correctly.

Credits and debits should be in the same field ([Amount]) so that you are able to do this to get the balance:

Balance: SUM([Amount])
 
We shouldn't be guessing at your table structure. Please describe the fields.

What does this really mean?

customer A 1/1/17 €20
2/1/17 €25
31/1/17 €25
01/02/17 €100
 

Users who are viewing this thread

Back
Top Bottom