Calculation method of cumulative balance in Access database

Source: Internet
Author: User
Tags access database

When accounting staff use manual bookkeeping, there will be a balance after "borrow" and "loan", which is the accumulated balance, that is, after each account is recorded. If you use computer bookkeeping, you can complete the calculation of the accumulated balance by querying.

First set up the table (assuming the save name is "financial balance"), the table must have a date, debit, credit, summary, and other fields, plus an AutoNumber field "ID." After design, input data.

Create a query. Add the necessary fields to the query. Then write an expression in a blank field--Balance: NZ ("borrow", "financial balance", "[Date]<#" & [Date] & "#")) +dsum ("Borrow", "financial balance", "[Date]=#" & [Date] & "# and [id]<=" & [ID])-nz (DSum ("credit", "Financial balance", "[Date]<#" & [Date] & "#")-dsum ("credit", "Financial Accounting"), [Date]=# & [Date] & # and [id]<= & [ID]].

Run this query to see the "Balance" field and the cumulative balance value you need.

Description: This query is only suitable for raw table data. If you want to filter in a query, the remaining balance may be problematic

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.