Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    11

    Unanswered: Updating a table field from a query that uses SUM

    Sorry for spamming, I just don't know how to append threads to include an attachment.
    Included is the Database I am making for my cousins garage.
    Heres the structure of my table (the columns in question)

    Cost - Currency
    Paid - Yes/No
    Used - Yes/No

    After a customer has paid the Paid tick box is ticked. When the user wishes to find out the balance they run a set of queries. The first query will SUM Cost WHERE Paid=True AND Used=False (The 'Used' column is in place so that the same entry is not added to the balance twice) and then take the SUM value and insert it into a table (destination will be a table called balance). The second query will set all of the entries used and set there 'Used' column to TRUE.

    TIA, Gareth.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Oh, this is what you meant.

    Don't do this. Don't try to store dynamic data in static fields, that's a bad, bad, bad idea.

    In general, you should never store redundant data, or data that can be derived from already existing data. Anytime you want to get the "balance", you run the query. That's what queries are for. They exist so you don't have to store that number somewhere else.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •