Results 1 to 4 of 4
  1. #1
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107

    New eyes on a quick update query


    I have an update query that I would like to run. For some reason, there are 21 records (the correct amount), but on the datasheet view, all 21 are blank and contain no data. Does anyone have an idea as to why this might be happening? I have two tables: Products, which is the table I would like to update, and Headcount, which contains the updated data.

    Code:
    UPDATE Products 
    INNER JOIN [People Headcount] ON Products.Number = [People Headcount].Project_Number 
    SET Products.[People Headcount] = [People Headcount].[Headcount];
    Does someone with fresh eyes see why this might be exporting blank records?

    Thanks for any help!!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would start with a SELECT Query and see what is pulled.

  3. #3
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107
    Hi RuralGuy, thank you for your response. When I run a select statement, I am able to pull 21 visible numbers. I have also tried an append query and again have 21 visible records. Any idea as to why this might be happening with an update statement?

    Thank you!

  4. #4
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107
    EDIT: I have looked all over, and am thinking that maybe the reason I am getting this error is because I am pulling in a saved query. [People Headcount] is a saved query that I am trying to add. Is there a way to incorporate this query into my update statement?

    Code:
    SELECT DISTINCT Product_Number, Count(*) AS Headcount
    FROM People_Pool
    WHERE People_Pool_Name Like "*Smith-Doe-adams*"
    GROUP BY Product_Number;
    In plain english, I want my statement to Update the People Headcount on the Products Table when the Product Project Number is equal to the People_Pool Project Number. I want the People Headcount become equal to the above query release.

    Is this possible to do in an update statement?


    Thank you!


    Previous Post:
    I tried to sort the empty records, both from largest to smallest and smallest to largest and received the following error:

    Syntax error in query. Incomplete query clause.

    Any idea what this might be?
    Last edited by Lorlai; 07-14-2011 at 10:28 AM. Reason: Found new information

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

Similar Threads

  1. Quick SQL Query question.
    By Suoipoc in forum Access
    Replies: 4
    Last Post: 09-06-2011, 09:10 PM
  2. VBA Excel Formatting: Need new eyes!!
    By Lorlai in forum Programming
    Replies: 3
    Last Post: 06-09-2011, 10:22 AM
  3. 3 Quick Q's
    By anoob in forum Access
    Replies: 5
    Last Post: 01-14-2011, 10:42 AM
  4. Quick help w/ Mailto??
    By Visfire in forum Programming
    Replies: 3
    Last Post: 09-17-2010, 08:36 AM
  5. quick query syntax questions
    By cowboy in forum Access
    Replies: 6
    Last Post: 02-03-2010, 06:10 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