Results 1 to 6 of 6
  1. #1
    kaitlinquinn is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    2

    Adding existing field to query returns blank


    I'm working with a query that was created by someone before me. It's a simple query that displays information that has been put into one database, but not another. All I'm trying to do is add an existing data field so that it displays when I run the query. However, when I added the field, everything in the new column returned blank. I looked into the table this field is pulling from and there is information in it, so I don't know why it's not displaying. I've tried all the fixes I can think of to no avail. Any help would be greatly appreciated!

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If the two tables are the same are you sure you're pulling the field from the correct table? Depending on the nature of your join there may not be data in the field for the specific items showing in the query, have you verified that some of your data actually has a value in that field that should appear?

  3. #3
    casinc815 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2013
    Location
    Chicago, IL
    Posts
    46
    please provide the SQL statement for review? Thanks!

  4. #4
    kaitlinquinn is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    2
    SELECT dbo_legheader.mov_number, dbo_legheader.lgh_refnum, dbo_legheader.lgh_tractor, dbo_legheader.lgh_carrier, dbo_legheader.lgh_startdate, tblCCLoads.LoadNo, dbo_legheader.lgh_startstate, dbo_legheader.lgh_endstate
    FROM dbo_legheader LEFT JOIN tblCCLoads ON dbo_legheader.lgh_refnum = tblCCLoads.LoadNo
    WHERE (((dbo_legheader.lgh_refnum) Is Not Null And (dbo_legheader.lgh_refnum)<>"0") AND ((dbo_legheader.lgh_carrier)<>"unknown" And (dbo_legheader.lgh_carrier) Not Like "XDCK*") AND ((dbo_legheader.lgh_startdate) Between #1/1/2013# And [start date]) AND ((tblCCLoads.LoadNo) Is Null))
    ORDER BY dbo_legheader.lgh_startdate, tblCCLoads.LoadNo;

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    which field from which table did you add to this query?

  6. #6
    casinc815 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2013
    Location
    Chicago, IL
    Posts
    46
    Quote Originally Posted by rpeare View Post
    which field from which table did you add to this query?
    dbo_legheader.lgh_refnum = tblCCLoads.LoadNo

    The above line indicates a join but how do you join a null value?

    Further down in the WHERE clause you are allowing for a null on tblCCloads.LoadNo!
    If this is true then your blank may be do to a null value somewhere in the data.

    Also, this field is in the OrderBY but it can be a null value.

    jim

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

Similar Threads

  1. I am stumped...adding field to existing table
    By tanyalee123 in forum Queries
    Replies: 6
    Last Post: 12-09-2013, 06:04 PM
  2. Replies: 3
    Last Post: 07-30-2013, 12:11 PM
  3. Adding field to form causes blank view.
    By emccalment in forum Access
    Replies: 1
    Last Post: 04-02-2010, 06:27 PM
  4. Replies: 0
    Last Post: 10-14-2009, 02:44 AM
  5. Replies: 1
    Last Post: 09-05-2008, 12:07 PM

Tags for this Thread

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