Results 1 to 10 of 10
  1. #1
    psanc03 is offline Novice
    Windows 10 Access 2002
    Join Date
    Nov 2020
    Posts
    5

    Unhappy Query appending 0 rows


    Below is the code
    trying to append rows from bc_stage_genomics into bc_genomics_masterlist but when I hit a run it says you are about to append 0 rows... any help after hours of trying to figure out why??

    UPDATE bc_genomics_masterlist INNER JOIN stage_bc_genomics ON bc_genomics_masterlist.InHouse_PatientID = stage_bc_genomics.InHouse_PatientID SET bc_genomics_masterlist.AbsLog_AuditLogDate = [stage_bc_genomics].AbsLog_AuditLogDate, bc_genomics_masterlist.InHouse_PatientID = [stage_bc_genomics].InHouse_PatientID, bc_genomics_masterlist.CaseconID = [stage_bc_genomics].CaseconID, bc_genomics_masterlist.Case_Control_Description = [stage_bc_genomics].Case_Control_Description, bc_genomics_masterlist.Registry = [stage_bc_genomics].Registry, bc_genomics_masterlist.DX_Year = [stage_bc_genomics].DX_Year, bc_genomics_masterlist.Current_Tissue_Age_Yrs = [stage_bc_genomics].Current_Tissue_Age_Yrs, bc_genomics_masterlist.Destruction_Risk = [stage_bc_genomics].Destruction_Risk, bc_genomics_masterlist.Formal_Request = [stage_bc_genomics].Formal_Request, bc_genomics_masterlist.Need_HER2 = [stage_bc_genomics].Need_HER2, bc_genomics_masterlist.Specimen_Types = [stage_bc_genomics].Specimen_Types, bc_genomics_masterlist.Tumor_Specimen_Notes = [stage_bc_genomics].Tumor_Specimen_Notes, bc_genomics_masterlist.Prev_Assessed = [stage_bc_genomics].Prev_Assessed, bc_genomics_masterlist.PathReport_Available = [stage_bc_genomics].PathReport_Available, bc_genomics_masterlist.PathReport_Notes = [stage_bc_genomics].PathReport_Notes, bc_genomics_masterlist.Tissue_Availability = [stage_bc_genomics].Tissue_Availability, bc_genomics_masterlist.Tissue_Notes = [stage_bc_genomics].Tissue_Notes, bc_genomics_masterlist.Neoadj_Therapy = [stage_bc_genomics].Neoadj_Therapy, bc_genomics_masterlist.Neoadj_Notes = [stage_bc_genomics].Neoadj_Notes, bc_genomics_masterlist.Tissue_Destruction_Status = [stage_bc_genomics].Tissue_Destruction_Status, bc_genomics_masterlist.Date_Planned_Tissue_Destruc tion = [stage_bc_genomics].Date_Planned_Tissue_Destruction, bc_genomics_masterlist.Tissue_Destruction_Notes = [stage_bc_genomics].Tissue_Destruction_Notes, bc_genomics_masterlist.Abstraction_Complete = [stage_bc_genomics].Abstraction_Complete, bc_genomics_masterlist.Abstraction_Notes = [stage_bc_genomics].Abstraction_Notes, bc_genomics_masterlist.Date_Tissue_Sent = [stage_bc_genomics].Date_Tissue_Sent, bc_genomics_masterlist.Tissue_Acquisition_Notes = [stage_bc_genomics].Tissue_Acquisition_Notes;

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,528
    this in an update query. it does not append any rows.

  3. #3
    psanc03 is offline Novice
    Windows 10 Access 2002
    Join Date
    Nov 2020
    Posts
    5
    The stage_bc_genomics is an append query and the goal is to update the bc_genomics_masterlist (update query) from the stage_bc_genomics.

  4. #4
    psanc03 is offline Novice
    Windows 10 Access 2002
    Join Date
    Nov 2020
    Posts
    5
    Then why am I receiving that message? Apologies, I am fairly new user and was adapting this code from someone else. The goal is to update rows from stage_bc_genomics into the bc_genomics_masterlist.

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,986
    You cannot use an APPEND query as the base for an UPDATE query!
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,815
    Change the append to a SELECT and see if you get anything. It would never occur to me to join an update query to an append and have to think it would never work. The entire sql gets processed (optimized) and Access decides how to interpret and then run it. However, the update isn't going to wait for your append to populate any table, which is what you do with an append. I can't see how joining these two could ever work. You could join an update to a select, however.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,986
    Actually I will slightly qualify my previous answer in that you can have a query that both APPENDS and UPDATES - commonly known as an UPSERT or UPEND query.
    See http://www.mendipdatasystems.co.uk/u...ery/4594428616

    However, that is a different concept than what you are trying to do...
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  8. #8
    psanc03 is offline Novice
    Windows 10 Access 2002
    Join Date
    Nov 2020
    Posts
    5
    Update

    The message says updating 0 rows. There are 156 rows of data I am trying to update the bc_genomics_masterlist with.

  9. #9
    psanc03 is offline Novice
    Windows 10 Access 2002
    Join Date
    Nov 2020
    Posts
    5
    Apologies, it is an update query and it is updating 0 rows when there are 156 rows of information in bc_stage_genomics and will not update into bc_genomics_masterlist. Thoughts?

  10. #10
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,986
    Same thoughts as already stated. You cannot use an APPEND query as the basis of an UPDATE query.
    The update query must be based on a table or a SELECT query
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Append Query multiples appending. HELP
    By AlliCrader in forum Queries
    Replies: 5
    Last Post: 07-29-2017, 09:02 AM
  2. Replies: 1
    Last Post: 10-29-2012, 02:02 PM
  3. Replies: 5
    Last Post: 06-19-2012, 03:16 AM
  4. Replies: 0
    Last Post: 02-09-2012, 05:43 PM
  5. Update some fields by appending query
    By lizzywu in forum Queries
    Replies: 7
    Last Post: 02-08-2012, 08:59 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