Results 1 to 7 of 7
  1. #1
    lbytesxk is offline Novice
    Windows XP Access 2002
    Join Date
    Sep 2011
    Posts
    4

    Simple query doesn't return anything

    Hello



    I have a very simple MSAccess 2002 table with only 7 columns.
    I'm trying to run a query that would group the data returned by one of the columns. It was actually generated by the query wizard and it still doesn't work because most likely I didn't do it right.

    Code:
    SELECT TBL_BurnIn_Info.Record_ID, TBL_BurnIn_Info.Part_Number, TBL_BurnIn_Info.Rack_Number, TBL_BurnIn_Info.Shelf_Number, TBL_BurnIn_Info.DateTime_In, TBL_BurnIn_Info.Test_Op, TBL_BurnIn_Info.Test_Op_Notes, TBL_BurnIn_Info.DateTime_Out_Actual, TBL_BurnIn_Info.DateTime_Out_Due
    FROM TBL_BurnIn_Info
    WHERE (((TBL_BurnIn_Info.Rack_Number)="Group By"))
    ORDER BY TBL_BurnIn_Info.DateTime_Out_Due;
    Can anyone help me find the problem with this?

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Can't see anything unusual in your query. Perhaps you should post your db with sample data. Run a compact and repair before uploading.

    Alan

  3. #3
    lbytesxk is offline Novice
    Windows XP Access 2002
    Join Date
    Sep 2011
    Posts
    4
    Hi
    Thanks for the reply
    I uploaded the db.

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Ok. Looked at your Query. In plain english, what are you hoping to accomplish with your query.

    By entering "Group By" in the criteria, you are telling Access to return all records having the term Group By in the Parts Number Field. Since you have numbers in that field you are getting null results. So, now tell us what you hope to accomplish with this query and we will get you there.

    Alan

  5. #5
    lbytesxk is offline Novice
    Windows XP Access 2002
    Join Date
    Sep 2011
    Posts
    4
    Oh, in that case I'm an idiot sir.
    What I'm trying to accomplish is to actually group the returned data by the Rack_Number column. Basically trying to implement a "Group By" clause in my query.
    I didn't intend to literally look for the string "Group By"

  6. #6
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Well, you have no data to group by. Group By typically will sum, average, count, etc all the data. Given what you have, the best I could do was to sort on the Rack Number Field.

    Here is that SQL

    Code:
    SELECT TBL_BurnIn_Info.Part_Number, TBL_BurnIn_Info.Rack_Number, TBL_BurnIn_Info.Shelf_Number, TBL_BurnIn_Info.DateTime_In, TBL_BurnIn_Info.Test_Op, TBL_BurnIn_Info.Test_Op_Notes, TBL_BurnIn_Info.DateTime_Out_Due
    FROM TBL_BurnIn_Info
    ORDER BY TBL_BurnIn_Info.Rack_Number, TBL_BurnIn_Info.DateTime_Out_Due;
    Which was nothing more than to remove the criteria you had in the part number and sort the Rack Number field.

    I hope this helps you to understand it. In any event, look here for further information on Grouping in a query.

    http://www.techonthenet.com/access/queries/index.php

    Scroll down to the section indicated as Group By.

    Post back if you need additional help

    Alan

  7. #7
    lbytesxk is offline Novice
    Windows XP Access 2002
    Join Date
    Sep 2011
    Posts
    4
    alansidman

    Thank you for your help, it is much apreciate it and it helped me understand the concept of grouping in a query which I obviously lacked before.

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

Similar Threads

  1. Replies: 2
    Last Post: 06-03-2011, 04:36 PM
  2. Parameter Query doesn't work
    By Kimmie in forum Access
    Replies: 5
    Last Post: 10-07-2010, 01:30 PM
  3. Query doesn't work the day after
    By sithis876 in forum Queries
    Replies: 1
    Last Post: 07-13-2010, 07:11 AM
  4. Why doesn't the table & Query update?
    By U810190 in forum Forms
    Replies: 1
    Last Post: 03-29-2010, 04:07 AM
  5. Query doesn't return all data
    By hawzmolly in forum Queries
    Replies: 6
    Last Post: 03-26-2010, 09:12 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