Chimp8471
07-29-2003, 12:54 AM
i need some help with a query that i am trying to set up.
I have a table called "tblEvents"
in which i store the following
Faultlog number - primary key
Daycode - this is the day of the year that the fault occurred (3209 - would represent 29th July 2003)
Line - Links to the machine that the fault occured on
Event Code - each fault is given a specific code A101 = Door fell off
Minor Stop, Major Stop, Breakdowns, Product Change, CIP, Maint - each event is catagorised into a specific stop group depending on the duration or fault type.
what i am trying to do is calculate the number of occurances of all stops on a specific line for each daycode. I am only really interested in the number of Breakdowns the other columns are not that important for this query.
for example
on daycode 3197
H7 - should be 2
H8 - should be 1 and so on
but i would also like it to display the total time for the day
for example
H7 - should read occurances = 2 & duration 114
Cheers
Andy
I have a table called "tblEvents"
in which i store the following
Faultlog number - primary key
Daycode - this is the day of the year that the fault occurred (3209 - would represent 29th July 2003)
Line - Links to the machine that the fault occured on
Event Code - each fault is given a specific code A101 = Door fell off
Minor Stop, Major Stop, Breakdowns, Product Change, CIP, Maint - each event is catagorised into a specific stop group depending on the duration or fault type.
what i am trying to do is calculate the number of occurances of all stops on a specific line for each daycode. I am only really interested in the number of Breakdowns the other columns are not that important for this query.
for example
on daycode 3197
H7 - should be 2
H8 - should be 1 and so on
but i would also like it to display the total time for the day
for example
H7 - should read occurances = 2 & duration 114
Cheers
Andy