473,406 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Reporting data between 6 'master' tables and 1 'child' table

I want to have seven tables (relationship between them already exists) that report the data as follows;

Table 1-6 - Masters: data is input here
Table 7 - Child: data from Master is relayed here

I have tried with a Query to no avail, and even though the master tables have test records populating them I cannot seem to get the necessary fields shown in the Child table... Help!
Mar 18 '14 #1
8 1736
zmbd
5,501 Expert Mod 4TB
You wouldn't do that with Table7 you would do that by query.
So what we need is a little more detail with tables 1 - 6, takeing just three for example:

tbl1
[tbl1_pk]
[tbl1_field1]

tbl2
[tbl2_pk]
[tbl2_field1]
[tbl2_fk_tbl1] (1:M with tbl1)

tbl3
[tbl3_pk]
[tbl3_field1]
[tbl3_fk_tbl1] (1:M with tbl1)
[tbl3_fk_tbl2] (1:M with tbl2)

Then we need to know what you have already attempted, so if you have the SQL (open the query in design view, right click in the show table area, select SQL view from the popup) then click on the [CODE/] button in the post toolbar and then copy and past the SQL script between the [code] [/code] tags.

From there tell us what fields from tbl1-3 you want to show (or in your case tables 1 thru 7 (^_^) ).
Mar 19 '14 #2
The SQL is as follows:

Expand|Select|Wrap|Line Numbers
  1. SELECT [Employee List].[Employee Name]
  2.    , [Employee List].[Pay rate]
  3.    , [Labor - Entry Scans].Station AS [Labor - Entry Scans_Station]
  4.    , [Labor - Entry Scans].[Entry Scan] AS [Labor - Entry Scans_Entry Scan]
  5.    , [Labor - Exit Scans].Station AS [Labor - Exit Scans_Station]
  6.    , [Labor - Exit Scans].[Exit Scan] AS [Labor - Exit Scans_Exit Scan]
  7.    , [Tracking - Entry Scans].Station AS [Tracking - Entry Scans_Station]
  8.    , [Tracking - Entry Scans].[Entry Scan] AS [Tracking - Entry Scans_Entry Scan]
  9.    , [Tracking - Exit Scans].Station AS [Tracking - Exit Scans_Station]
  10.    , [Tracking - Exit Scans].[Exit Scan] AS [Tracking - Exit Scans_Exit Scan]
  11.    , [Tracking Detail].[Work Ticket ID], [Tracking Detail].ID
  12. FROM [Tracking Detail] 
  13.    INNER JOIN ([Tracking - Exit Scans] 
  14.       INNER JOIN ([Tracking - Entry Scans] 
  15.          INNER JOIN ([Labor - Exit Scans] 
  16.             INNER JOIN ([Labor - Entry Scans] 
  17.                INNER JOIN ([Employee List] 
  18.                   INNER JOIN [Work Tracking] 
  19.                      ON ([Employee List].[Pay rate] 
  20.                         = [Work Tracking].[Rate]) 
  21.                         AND ([Employee List].[Employee Name] 
  22.                            = [Work Tracking].[Employee Name])) 
  23.                   ON [Labor - Entry Scans].[Entry Scan] 
  24.                      = [Work Tracking].[Labor - Entry Scans]) 
  25.                ON [Labor - Exit Scans].[Exit Scan] 
  26.                   = [Work Tracking].[Labor - Exit Scans]) 
  27.             ON [Tracking - Entry Scans].[Entry Scan] 
  28.                = [Work Tracking].[Tracking - Entry Scan]) 
  29.          ON ([Tracking - Exit Scans].[Station] 
  30.              = [Work Tracking].[Station])
  31.             AND ([Tracking - Exit Scans].[Exit Scan] 
  32.                   = [Work Tracking].[Tracking - Exit Scan]))
  33.       ON ([Tracking Detail].[ID] 
  34.           = [Work Tracking].[ID])
  35.          AND ([Tracking Detail].[Work Ticket ID] 
  36.             = [Work Tracking].[Work Ticket ID]);
>>

If you need more details let me know!!
Mar 19 '14 #3
zmbd
5,501 Expert Mod 4TB
Exactly how did this SQL fail you?
The more related information you can give, the fewer posts it should take to help you reach your goal.
Mar 19 '14 #4
Well, the table is used for tracking inventory. This query picks up all the needed data for reports, views etc and is supposed to be a single place repository for all the needed data to then be used, edited and changed by the users. The issue that I have with the SQL is that I need an action that can report the data input in every single one of the selected fields from the populated master tables.

As of this moment, the relationships work and I get the heading views I want, but none of the already input test data is reporting in the related fields... Help...
Mar 19 '14 #5
zmbd
5,501 Expert Mod 4TB
1) Which Version of Access/Office

2) Do you have the privilage of changing the field names?
The spaces are allowed now (however, I still advise against them) but using the dash sign can lead to issues.
Access 2007 reserved words and symbols
AllenBrowne- Problem names and reserved words in Access

3) It' will take a little bit to digest your SQL

4) It would help if you would list your tables as I outlined in Post#2 . This way we can see if there are any logic errors in your joins.

5) When you set up your table relationships, did you use the "Wizard" at table level or did you use the Database tools and set the relationships using the relationships tool?
Mar 19 '14 #6
1)Access 2013/Office 365

2)I am the sole user (for now) creator and administrator of the file.

3)Sorry about that. The whole idea is to have a query or a central table reporting the required fields from all the other tables. This would be a view only (no edit capability) table for the end users to see.

4)(Due to confidentiality agreements I have changed the names, yet I've left the relationships) * = Primary Key. ** = Current relationship join to main table:

Main Table:
ID*
ENTRY SCAN-A
EXIT SCAN-B
ENAME
RATE
ENTRY SCAN-C
EXIT SCAN-D
STATION
PART_ID

Table 1:
ID**
DESCRIPTION
SIZE
CNAME
CID
ATIME
EPROC

Table 2:
RECORD#*
ID**
PART_ID
ENAME
EID
STATION
ENTRY SCAN-A

Table 3:
RECORD #*
EID
ENAME**
STATION
RATE

Table 4:
RECORD #*
ID**
PART_ID
ENAME
EID
STATION
EXIT SCAN-B

Table 5:
RECORD #*
ID**
PART_ID
STATION
ENTRY SCAN-C

Table 6:
RECORD #*
ID**
PART_ID
STATION
EXIT SCAN-D

That is the table structure. The tables in which RECORD # is the PK is due to the fact that the regular PK, ID will be used multiple times in the same table, as the job moves from station to station, each ID can repeat with different stations, times, etc.

Sorry about the complexity of it :/
Mar 21 '14 #7
And 5)I used the relationship wizard on the database tools ribbon (I selected who's related to who)
Mar 21 '14 #8
zmbd
5,501 Expert Mod 4TB
I think you need to renormalize\design your database and then your entire issue will dissolve; however, I really can't make heads nor tails of your workflow...

Compounding the issue is that the SQL you posted in 3 doesn't match the tables in posted in 7 so attempting to related the information just doesn't work...

I understand confidentiality; however, we can change Company and part names to generics like "Company" and "BlueWidget1" then post back the SQL and tables so that they make sense.

Please indicate the relationships as I did in post 2

Tbl_Example
[field] PK
[field2] FK((1:M with Tbl_Example2)
Mar 24 '14 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Caroline | last post by:
I seem to always want to do this type of join, but I can never find how to do this. I am trying to join two tables. The parent table will always have one row of data and the child may have 0 to...
2
by: reneeccwest | last post by:
There are two tables, parent and child table. Foreign key field of the child table is not a required field. If the data is submitted w/o a value into the foreign key field, what should I make it...
9
by: Bob C. | last post by:
I want to create a 1-many relationship. Parent table has a primary key, child table has no primary key. The child table does have an index with all four fields of the parent's PK. How can I do...
1
by: Johann Blake | last post by:
I have a dataset that contains a parent table and a child table. A DataRelation exists between the two. I was under the impression from reading the VS docs that when I filled the parent table, the...
11
by: Kay | last post by:
Hi all, I have populated a dataset with several tables, say - Roster, Agent and few more . The dataset is used to populated a listview with some shift info.. I think I'm sucessfully created a...
1
by: Hardik Shah | last post by:
Hi, I have created a form for sales bill information. I am using two tables, its salient filds are as below. 1) Bill - Fields - bill_id,customer_id,tdate 2) Itemtran - Fields -...
0
by: latin & geek via DotNetMonster.com | last post by:
hi! ok, im working on a database application. ive successfully managed to establish a relationship between two tables and display them on a datagrid, edit and add new records to them. now i...
11
imrosie
by: imrosie | last post by:
Hello Experts This is a hard one (I still speak newbie). An expert may think it's not a big deal, but, I am trying to replace my Main Order form with a subform because of the following: ...
0
by: ahniyas | last post by:
I have created a Master Table for Department And a Child Table for employees.Also created a Master-Child Relationship. But I don't know to display data from both table simultaneousy on asp page...
6
by: abdul4588 | last post by:
I Have Two Table City(CityId,CityName) Emp(EmpId,Name,Age,Salary,CityId) Where In City CityId Is PrimaryKey. In Emp EmpId Is PrimaryKey And CityId Is ForeignKey. I Want To Know How To...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.