Results 1 to 7 of 7
  1. #1
    Podder is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    22

    Invoice Payments Query

    Hi,
    I am trying to create a query to check what invoices have not been paid and how much is owing.
    My setup is as follows:
    WeeklyInvoiceTBL


    ID
    InvNo
    Area
    Customer
    InvDate
    Item
    Quantity

    PaymentsTBL
    InvNo
    Area
    InvDate
    TotalAmount
    PayDate

    ItemsTBL
    ID
    Item
    Cost

    I have then made a query which as the following
    InvoiceTotalsQry
    InvNo
    InvDate
    Area
    SumOfQuantity
    Item
    Cost
    GrossAmount

    What Im trying to ahcieve is a Query that will show all invoices sent and also show invoices that have been paid.
    When an Invoice has been paid, show 0, when an invoice has not been paid, show GrossAmount.
    Currently, I have a query which shows all invoices paid but not the unpaid ones.

    Is this possible.

    Thanks

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    I have a query which shows all invoices paid but not the unpaid ones.
    would be helpful to see your query sql but suspect you need a left join on InvNo between WeeklyInvoiceTBL and PaymentsTBL

    When an Invoice has been paid, show 0, when an invoice has not been paid, show GrossAmount.
    I don't see an invoice total amount, but assuming there is one deduct paid amount from this value

  3. #3
    Podder is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    22
    Ajax,
    Invoice total = GrossAmount (sorry for the lack of clarification)
    The problem I am having is the InvoiceNo in the InvoiceTotalsQry is not present in the PaymentsTBL, Im trying to determine if theres a way of putting all invoiceNo's in the query, then doing as you suggested.

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Create a query that joins the items to the invoices, use this to generate the total cost.
    It's very unusual not to store invoice lines with prices and a line total, as prices can change over time, and you may offer a line discount?

    Use that query with a left join to your payments.
    Create a calculated field taking the payment from your invoice total.

    You should now have all invoices and the total outstanding.
    Either filter by = 0 for paid one or > 0 for unpaid ones
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    The problem I am having is the InvoiceNo in the InvoiceTotalsQry is not present in the PaymentsTBL
    so why are you showing it?

    PaymentsTBL
    InvNo
    Area
    InvDate
    TotalAmount
    PayDate



  6. #6
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,570
    HiCan you upload a copy of the database?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  7. #7
    Podder is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    22
    Quote Originally Posted by Minty View Post
    Create a query that joins the items to the invoices, use this to generate the total cost.
    It's very unusual not to store invoice lines with prices and a line total, as prices can change over time, and you may offer a line discount?

    Use that query with a left join to your payments.
    Create a calculated field taking the payment from your invoice total.

    You should now have all invoices and the total outstanding.
    Either filter by = 0 for paid one or > 0 for unpaid ones
    Minty,
    Thanks, your solution worked.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 09-24-2021, 08:26 AM
  2. Replies: 2
    Last Post: 09-14-2015, 09:01 AM
  3. Invoice and payments received
    By esther6086@lowcountry.com in forum Queries
    Replies: 1
    Last Post: 08-13-2013, 06:28 PM
  4. Need To Sum Payments in Query
    By burrina in forum Queries
    Replies: 3
    Last Post: 11-27-2012, 05:35 PM
  5. Replies: 3
    Last Post: 11-19-2012, 05:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums