I want to create a query that pulls specific names out of a few fi

O

oxicottin

Ok, I want to create a query that pulls specific names out of a number of
fields.
I have 7 fields labeled, Operator1,Operator2,etc. all of these fields are
drop down boxes which you can select a specific operator/Employee who ran a
specific machine for each day ect. My question is how would I create a query
that I can ask for specific information on an employee /operator for a date
range? My problem is on each record there could be 7 operators ect. I
understand the way all this was set up isnt good but this is how my boss
wanted to look at each record. He wanted to see what was going on for each
employee on each shift ect. Please help im lost on this one!!! or is there
another way I can set up each record on the Main form where it would be easer
to pull info from for a specific operator using the same format? ( 7 drop
down boxes) Thanks!!

Thanks!
Chad
 
D

Duane Hookom

You shouldn't use "wanted to look" when creating table structures. Also, you
didn't provide any date reference in your provided field list. How can
anyone tell you how to query a date range without a date field?

If you can't change the structure, you can normalize it using a union query:
SELECT ID, WeekOf, Operator1 As Operator, WeekOf + 0 as OperDate
FROM qselNoNameProvided
UNION ALL
SELECT ID, WeekOf, Operator2, WeekOf + 1
FROM qselNoNameProvided
UNION ALL
SELECT ID, WeekOf, Operator3, WeekOf + 2
FROM qselNoNameProvided
UNION ALL
-- etc for 7 days.
 
O

oxicottin

There is a date field I just didnt mention I assumed everone would know. I
have a date field, 7 fields/drop downs that I select the operator/employee
thats running a specific machine I also have 7 fields that is time (time as
in how many hours that employee worked on the specific machine) and a field
that tells me the operators delay time ( how long the machine wasnt running).
My boss wanted to look at each shift and have it display all this info and
some. But he also wanted a button that I can put the date range and operators
name in so he could look at how a perticular operator/employee is doing lets
say for the week ect.
 
D

Duane Hookom

How about you take the time to enter some sample records with significant
fields so that we can understand your data well enough to answer your
question without guessing? Or at least provide a list of significant fields
and what type of data you are storing. Please share your table name also.
 
W

WildCHR

Well, I understand perfectly... You want a parameter query with the
parameter being the combo box. Doesn't take SQL or a degree to
institute it... In the criteria area, right click and choose build,
then follow your way to your form and your combo and your value, then
all you need to do is have a similar control that you can use as the
date range.

Good luck,
WildCHR
 
D

Duane Hookom

I think the combo box would need to be applied to filter based on any one of
seven, un-normalized fields in the query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top