Results 1 to 7 of 7
  1. #1
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167

    Update Querry

    Hi Everyone,



    I am trying to update a table that has been offline for a bit with a table that was being used. They contain exactly the same fields and datatypes. I assume there is a way to update all fields at once. (This is a Student Information Table so it has about 24 fields.) Can anyone show me what the SQL would look like for this (just beginning to use SQL over "Design View"). I'm using MS Access 2010 and the two tables are ContactInformation (existing and to be updated) and ContactInformation1 (containing new info for some records).

    Thanks and take care,

    Daryl

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Do you need to update existing records or add new records or both?

    Do these tables have autonumber field?

    Are the fields in the table in the same order when viewed in design?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167
    Hi,

    Thanks for the reply. I only need to update existing records. The PK is autonumbered in both tables. The fields in the table are in the same order. They are identical in evryway except some filed may have had the data changed.

    Take care,

    Daryl

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    If the PK is autonumber in both tables, then what would be the unique ID that will link records?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167
    Hi JUne,

    Ooops. The PK is not an autonumber field. I used StudentID as the PK and it is a text field. This was very early in building the DB and there may be some inherent difiiculties with this. I think my rationale was that some StudentIDs began with zeros (0001234) and the number data type would truncate the zeros.Not really an issue but I think I went with text to keep the format the same.

    So it is the StudentID field which links the two tables. Each StudentID is enter by the user as a new student is enrolled.

    Thanks agian,

    Daryl

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    The records are unique for each student - only one record for each student?

    See if this helps http://www.ehow.com/how_7494463_upda...her-table.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167
    Thanks June. That was helpful.

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

Similar Threads

  1. Search querry
    By sdc1234 in forum Queries
    Replies: 14
    Last Post: 06-22-2013, 08:21 AM
  2. Querry question.
    By ZJGMoparman in forum Queries
    Replies: 2
    Last Post: 02-20-2013, 11:37 AM
  3. update querry Problem
    By newtoAccess in forum Queries
    Replies: 1
    Last Post: 04-04-2011, 09:33 AM
  4. Update Querry
    By wrenchman123 in forum Queries
    Replies: 0
    Last Post: 02-05-2011, 07:21 AM
  5. Querry formating
    By Zoroxeus in forum Queries
    Replies: 0
    Last Post: 03-07-2006, 11:00 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