Cumulative calculation in ACCESS

yank Posted messages 1 Status Member -  
castours Posted messages 2955 Registration date   Status Member Last intervention   -
Hello,
I am currently designing a database in Access 2007. I would like to have an SQL query that allows me to automatically display the total of payments, the remaining amount to be paid, in the fields "Montant_cumulé_versement", "reste_a_payer" from the table LOCATION_VENTE based on the payments made in the field "Versement" from the table PAIEMENT. I don't know how to go about it, so I am asking for your help!
NB:
- Montant_vente = Total sale price of the property

The other option that can be considered is as follows:

In fact, I want to keep track of sales in an Access 2007 database, so I would like to have a SQL or parameterized query that will display Numero_identité, Nom, Prenom, Numero_contrat, Numero_local, Type_local, Ville, Montant_vente, Versement by calculating the total of payments and the remaining amount to be paid for each client. I really don't know how to go about it, so I am asking for your help!!!
NB: I would like to remind you that "Montant_vente" is the sale price of the property and "Versement" constitutes the monthly payment.
The fields (Numero_identité, Nom, Prenom) are in the CLIENT table, (Numero_contrat, Numero_local, Type_local, Ville, Montant_vente) are in the VENTE table, and the field "Versement" is in the PAIEMENT table.

I would be very grateful if you could help me

Thank you in advance!!!

Configuration: Windows 7 / Chrome 21.0.1180.89

2 answers

  1. castours Posted messages 2955 Registration date   Status Member Last intervention   217
     
    Hello
    Cumul: SomDom("Qte";"T_Conso";"N°List <=" & [N°List])
    In a query, the example above calculates the cumulative total of the Qte field in the cumulative column.
    1
    1. lemanitou
       
      I have the same problem as Yank. And when I follow the solution proposed by Castours, I get the cumulative total all at once. That is to say, the criteria are not taken into account.
      NB: I am using Access 2007.
      0