Results 1 to 10 of 10
  1. #1
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83

    Updating Numeric Values


    I have two records that are brought in from an outside source. However, in my database I need their fees and payments to be combined because, now, they are one entity in our system, but the system I am getting them from does not know that. So i have tried multiple update queries that aren't working. Any suggestions would be appreciated. Thanks in advanced

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    didn't get you. what do you want to do?

  3. #3
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83
    Let me know if this helps, here is an example of what I mean (simplified):

    An outside table is imported into my access table with this information, and I can't modify the information outside of access:

    FacilityA $0 $10
    FacilityB $5 $0

    In reality our program combined FacilityA and FacilityB, but it is still separated in the outside table (can't be changed in that outside table). What I need is an update query (or another query) to tell my access table to update FacilityB to FacilityA values, to give me:

    FacilityB $5 $10

    I need this done because other tables that join with this have FacilityB, but do not have FacilityA. Simply changing the name of FacilityA to B will not do it either because it brings in other values from other tables twice that I do not need.

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    You example is very helpful.
    I assume you table has this fields:
    ID Facility Fee payment
    11 FacilityA $0 $10
    11 FacilityB $5 $0
    23 FacilityA $0 $11
    23 FacilityB $6 $0

    there should be a pair of records for each ID, is it right?

    the update query:

    update tbl inner join tbl as tbl1 on tbl.id=tbl1.id set tbl.payment=tbl1.payment where tbl.facility="FacilityB" and tbl1.facility="FacilityA"

    after checking, you can remove the records with "FacilityA"
    delete * from tbl where facility="FacilityA"

  5. #5
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83
    I will try this out but my table is setup like this, but there are not pairs

    Code Facility Date Fee Payment

    A FacilityA 10/1 $0 $10
    B FacilityB 10/1 $5 $0

  6. #6
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83
    Actually I have two Primary keys, The Facility and Date

  7. #7
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    did you mean there are always 2 records for each day? if so, the date is the id.

  8. #8
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83
    this external data is appended each month to the table, so the next month will read:

    FacilityA 11/1/2010
    FacilityB 11/1/2010

    So yes i didn't even think about it, but my ID can be the date

  9. #9
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83
    It is asking me to enter a parameter value for tbl1 when I try to run the query

  10. #10
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83
    Fixed the problem when I switched to design mode...thanks for the help

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

Similar Threads

  1. Recordset not showing alpha-numeric entries
    By rayhawk in forum Access
    Replies: 9
    Last Post: 10-29-2010, 08:15 AM
  2. Creating a Flat File with Signed Numeric Data Fields
    By two_smooth in forum Database Design
    Replies: 2
    Last Post: 10-27-2010, 08:31 AM
  3. updating a form with new values
    By markjkubicki in forum Programming
    Replies: 16
    Last Post: 08-27-2010, 10:08 AM
  4. order by - string and numeric
    By pen in forum Queries
    Replies: 10
    Last Post: 05-20-2009, 06:29 AM
  5. Numeric value out of range (null)
    By PPCMIS2009 in forum Queries
    Replies: 0
    Last Post: 02-03-2009, 11:01 AM

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