Query logic

Hi, Experts -
I have a query that is appending rows to an empty table - and uses as input a file containing one row for each employee in our company.  
Following each employee row is could be:
-  One-or-more rows of dependents
-  Another employee row.
The query is currently reading each row of input, and creating one row of (reformatted) output.  However, for each dependent row of output - I need to include a value that only resides on the associated employee row.  In the sample below, the value is either "Union" or "Mgmt."  I need to transfer this onto the associated Dependent rows.  How can I do this in my query?

Sample input:  EE=employee row  DE = dependent row
EE   Union   Joe Smith
EE   Mgmt    John Davies
DE               Sally Davies
DE               John Davies, Jr.
EE   Mgmt    Billy Bob Jefferson
(...and so on.)

Resulting output (desired):
EE   Union   Joe Smith
EE   Mgmt    John Davies
DE   Mgmt    Sally Davies
DE   Mgmt    John Davies, Jr.
EE   Mgmt    Billy Bob Jefferson
(...and so on)
LVL 1
OGSanAsked:
Who is Participating?
 
eantarConnect With a Mentor Commented:
If you're working with a single table that has both the Employees and the dependants, create two queries one for ONLY EE records, and one for ONLY DE employees. Make sure that there is an employee ID in both queries. Then create a third query to link the employees to the dependents. And drag the UnionManagement field from the Employees query.

E
0
 
eantarCommented:
Your query should be a link between the main and the dependant tables, yes? if so, in your query designer, drag the field that says Union or Management from the main table and you'll get the results you're looking for.

Let me know if you need more.

E
0
 
OGSanAuthor Commented:
Thanks, eantar!  Sometimes I get caught up in heads-down activity that I don't see the forest for the trees.  Building an intermediate set of results will work for me.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.