Results 1 to 12 of 12
  1. #1
    here4real is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    7

    Query not pulling all data


    I created a query with 2 local tables. One has email address and phone numbers. The join is being done on first name and last name. It pulls in the email address fine. However, the phone number remains blank even when there is valid data. All of the fields are short text.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Provide the SQL statement. Provide sample of data. If you want to provide db for analysis, follow instructions at bottom of my post.

    Join should be on ID fields not name parts.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    here4real is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    7
    It is the query with Comm merged with cc. I tried doing it as an update query and storing it on the record as well as just a query. Nothing worked.

    SELECT [RC Dem Committee w/ UPPER Names].*, [CC w/ UPPER Names].HPhone, [CC w/ UPPER Names].MPhone
    FROM [RC Dem Committee w/ UPPER Names] LEFT JOIN [CC w/ UPPER Names] ON ([RC Dem Committee w/ UPPER Names].LName = [CC w/ UPPER Names].LName) AND ([RC Dem Committee w/ UPPER Names].FName = [CC w/ UPPER Names].FName);

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Well, the SQL looks fine.

    I would have to review data.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    here4real is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    7
    Attached file has screenshots of data and structure
    Attached Files Attached Files

  6. #6
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Providing the table designs in Word isn't particularly helpful. However, based on that you should
    1. Add a primary key field to each table and use that for your query join
    2. Remove all spaces and special characters in table and field names
    3. Remove what appears to be duplicate fields in each table e.g. First Name and FName and only have the remaining fields in one table. Data should only be entered once.

    June asked to see example data. I missed that at first but it would make more sense to upload the actual database (or part of it).
    I'm not surprised you are having problems with query joins with that data
    If that is real data please remove the previous zip file, modify the data and reupload in Access
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  7. #7
    here4real is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    7
    File is too big to attach. I can try to trim it down.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    You shouldn't post files with real names and emails.

    I still can't determine cause of issue. Not even showing same names in both tables. Can't see entire output of query.

    This is a case where need to work with db.

    Strongly advise not to use spaces nor punctuation/special characters in naming convention.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    here4real is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    7
    1. Add a primary key field to each table and use that for your query join
    I can add primary keys to both tables but there is nothing to relate them. The only relationship is first name and last name.

    2. Remove all spaces and special characters in table and field names
    I've never had to do that before but if it fixes it....

    3. Remove what appears to be duplicate fields in each table e.g. First Name and FName and only have the remaining fields in one table. Data should only be entered once.
    FName is just the UPPER CASE version of First Name in order to match the data (inconsistent data entry). FName in the Committe table was only added to see if it would work with stored data (through Make Table) rather than a Query. It didn't help.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    1. Is data imported from different sources?

    2. No, that won't fix issue, just good practice. Otherwise have to remember to enclose in [].

    3. UPPER CASE can be calculated when needed. No need to actually save into table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    here4real is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    7
    The data is coming from 2 different sources.

    See attached
    Attached Files Attached Files

  12. #12
    here4real is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    7
    I figured out the problem.

    The data is crap. Last Name is actually first name and last name. Sometimes. Very inconsistent.

    Thank you!

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

Similar Threads

  1. Query not pulling all data
    By smithub in forum Access
    Replies: 2
    Last Post: 03-21-2018, 10:50 AM
  2. Data not pulling through to query
    By halnurse in forum Queries
    Replies: 1
    Last Post: 12-28-2017, 05:25 PM
  3. Pulling data into a form from query on a web app
    By DianeArthur in forum Access
    Replies: 0
    Last Post: 08-07-2016, 10:46 AM
  4. Query pulling the same data three times.
    By halabis in forum Queries
    Replies: 10
    Last Post: 10-29-2015, 09:56 AM
  5. Have 3 tables - problem with pulling data for query
    By wulfhund in forum Database Design
    Replies: 2
    Last Post: 08-13-2010, 05:38 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