Results 1 to 8 of 8
  1. #1
    brianrrrr13 is offline Novice
    Windows 11 Access 2021
    Join Date
    Jul 2024
    Posts
    3

    Relationship/Data Base Trouble. Query does not return expected or most often no values


    My database will have one 'master' table that is configured in this way

    Assembly Type_ID Part_ID Description Unique Identifier/Code Attribute 1 Heading_ID Attribute 1 Value_ID Attribute 2 Heading_ID Attribute 2 Value_ID Attribute 2 Heading_ID Attribute 3 Value_ID
    Number Number short text Short Text Number Number Number Number Number Number
    Assembly Type Assembly Type_ID Attribute Heading Attribute Heading ID Attribute Value Attribute Value ID
    Short Text autonum Short Text autonum Short Text autonum




    So what the idea is to set up relationships between all of these tables to be able to return actual text values from the codes in the 'master' database. My issues are the following:
    ID_ATTRIBUTE and ID_Heading relationships are allowing me to do alias, because when I pull them up into a query it shows 3 relationships to the original table and the made aliases.
    The next problem is when I use the query, all I get is a blank table. I suspect it is because the query will not return an empty value, but in this database many 'Null' values are expected.
    Anyone have any suggestions???

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,575
    Well to start with, your table/DB is not normalised.
    You must be an Excel user?

    Plus you have not even shown us what the query code is?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    brianrrrr13 is offline Novice
    Windows 11 Access 2021
    Join Date
    Jul 2024
    Posts
    3
    Yes you are correct. I do not believe it's a query problem but instead a relationship problem. What do you mean by Normalised? This is the relationship I'm having trouble with. The idea is the same as the initial posting, but I switched around field names as to not be confusing
    Here is the SQL code:
    SELECT CALL_DRAWINGS.DRAWING, ID_PumpType.PumpType, [ID_DIN-FIND].[DIN-FIND], ID_ATT_VALUE.ATT_VALUE, ID_ATT_VALUE_1.ATT_VALUE
    FROM ID_PumpType INNER JOIN (ID_ATT_VALUE AS ID_ATT_VALUE_1 INNER JOIN (ID_ATT_VALUE INNER JOIN ([ID_DIN-FIND] INNER JOIN (ID_PumpSize INNER JOIN CALL_DRAWINGS ON ID_PumpSize.ID = CALL_DRAWINGS.[PUMP SIZE]) ON [ID_DIN-FIND].ID = CALL_DRAWINGS.[DIN-FIND]) ON ID_ATT_VALUE.ID = CALL_DRAWINGS.[ATT1 VALUE]) ON ID_ATT_VALUE_1.ID = CALL_DRAWINGS.[ATT2 VALUE]) ON (ID_PumpType.ID = ID_PumpSize.PT_ID) AND (ID_PumpType.ID = [ID_DIN-FIND].PT_ID);



  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Post 3 was moderated. FYI, attachments need to be attached via the "Go Advanced" screen:

    https://www.accessforums.net/showthread.php?t=70301
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Post 3 was re-moderated again due to an invalid attachment. I'm posting to trigger email notifications.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,941
    What do you mean by Normalised?
    https://www.databasestar.com/database-normalization/

    some example data and what outcome you expect from that example data will also help us to help you

  7. #7
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    Quote Originally Posted by brianrrrr13 View Post
    My database will have one 'master' table that is configured in this way

    Assembly Type_ID Part_ID Description Unique Identifier/Code Attribute 1 Heading_ID Attribute 1 Value_ID Attribute 2 Heading_ID Attribute 2 Value_ID Attribute 2 Heading_ID Attribute 3 Value_ID
    Number Number short text Short Text Number Number Number Number Number Number
    Assembly Type Assembly Type_ID Attribute Heading Attribute Heading ID Attribute Value Attribute Value ID
    Short Text autonum Short Text autonum Short Text autonum




    So what the idea is to set up relationships between all of these tables to be able to return actual text values from the codes in the 'master' database. My issues are the following:
    ID_ATTRIBUTE and ID_Heading relationships are allowing me to do alias, because when I pull them up into a query it shows 3 relationships to the original table and the made aliases.
    The next problem is when I use the query, all I get is a blank table. I suspect it is because the query will not return an empty value, but in this database many 'Null' values are expected.
    Anyone have any suggestions???
    Oh yikes. It's a crosstab query. I'd do it in Excel (that's what I always say these days.) Open Excel, Get Data, from (whatever source type it is). Convert the Attribute columns to TEXT. Then Merge the pairs with a delimiter in the middle, like "|"). So if you end up with ONE column for each (Heading | Value) pair. Then you unpivot that mess. Then you split it by "|", and finally convert back to numbers. Then import.

    If you can, post a dummy without any confidential column values and I'll see if I can do it.

  8. #8
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,823
    Hi
    Best to upload a zipped copy of your database.

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

Similar Threads

  1. Replies: 2
    Last Post: 02-23-2018, 03:12 PM
  2. Replies: 14
    Last Post: 04-22-2015, 06:57 PM
  3. Replies: 4
    Last Post: 07-28-2014, 10:30 AM
  4. Front end trouble on split Data base
    By Cran29 in forum Access
    Replies: 3
    Last Post: 01-30-2013, 08:53 AM
  5. Having trouble with dates in my Data Base!!!!
    By BigPhil in forum Queries
    Replies: 4
    Last Post: 02-15-2006, 12:47 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