Results 1 to 3 of 3
  1. #1
    Profector is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2010
    Location
    Kansas City
    Posts
    4

    Update Query Question

    Can someone help me work through this query please?

    I'm trying to copy data from one table to another where the destination field isn't null or empty.

    The two tables are tblWeights (source table) and dbo_ARHistory (destination). Here's my idea.

    UPDATE dbo_ARHistory INNER JOIN tblWeights ON dbo_ARHistory.chst_id = tblWeights.cbox_id

    if dbo_ARHistory.chst_weight IS NOT NULL or dbo_ARHistory.chst_weight <> "" then


    SET dbo_ARHistory.chst_weight = tblWeights.cbox_weight

    from dbo_ARHistory, tblWeights

    WHERE dbo_ARHistory.chst_order=tblWeights.cbox_order;


    Any Ideas?

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    What you need is the correct syntax:

    UPDATE dbo_ARHistory INNER JOIN tblWeights ON dbo_ARHistory.chst_id = tblWeights.cbox_id and dbo_ARHistory.chst_order=tblWeights.cbox_order
    SET dbo_ARHistory.chst_weight = tblWeights.cbox_weight
    where dbo_ARHistory.chst_weight IS NOT NULL or dbo_ARHistory.chst_weight <> ""

  3. #3
    Profector is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2010
    Location
    Kansas City
    Posts
    4
    Thanks for the help Weekend00. The syntax of that query was driving my crazy.

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

Similar Threads

  1. Update Query with parameter query
    By mimikate in forum Queries
    Replies: 2
    Last Post: 03-16-2010, 09:10 PM
  2. Update Query Which Asks Question
    By jhillbrown in forum Access
    Replies: 3
    Last Post: 02-15-2010, 06:36 AM
  3. Update Query- selective update?
    By stephenaa5 in forum Queries
    Replies: 1
    Last Post: 10-29-2009, 11:15 AM
  4. Update question
    By oakoen in forum Access
    Replies: 3
    Last Post: 08-28-2009, 07:21 AM
  5. update query question
    By blusk06 in forum Queries
    Replies: 3
    Last Post: 05-30-2008, 05:55 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