OSU-BigToe
New member
- Local time
- Yesterday, 23:21
- Joined
- Mar 23, 2013
- Messages
- 6
I have a database that I am building to look at the run rates and machine efficiency. I have a table that has the following columns
-- "Main" Table --
"Line #"-which production line it was run on
"Sample #" -the production order for the day (i.e 1, 2, 3...)
"Time in" -time that the product started running
"Time Out" -time that the product finished running
"Date Code"
"Startup-Changeover Time"
--"Start Time" Table--
"Date Code"
"Line #" (linked to Line # in "Main" Table")
"Start time"
I need to do two things, both are update queries that will update the "Startup-Changeover Time" column
1. If "Main.sample #" = 1 then take the "Main.Time in" from the same row and subtract it from "Start Time.start time" from the same "date code" and "line #"
2. If "Main.sample #" > 1 then take the "Main.Time in" from the same row as "Main.sample #" and subtract it from the ""Main.Time Out" from "Main.sample #"-1 (i.e if the sample # is 3 then I want to look at the time out from sample # 2) from the same "date code" and "line #
I hope that this makes sense. If there are any questions or it would be easier to see the database let me know. Thanks for your help
-- "Main" Table --
"Line #"-which production line it was run on
"Sample #" -the production order for the day (i.e 1, 2, 3...)
"Time in" -time that the product started running
"Time Out" -time that the product finished running
"Date Code"
"Startup-Changeover Time"
--"Start Time" Table--
"Date Code"
"Line #" (linked to Line # in "Main" Table")
"Start time"
I need to do two things, both are update queries that will update the "Startup-Changeover Time" column
1. If "Main.sample #" = 1 then take the "Main.Time in" from the same row and subtract it from "Start Time.start time" from the same "date code" and "line #"
2. If "Main.sample #" > 1 then take the "Main.Time in" from the same row as "Main.sample #" and subtract it from the ""Main.Time Out" from "Main.sample #"-1 (i.e if the sample # is 3 then I want to look at the time out from sample # 2) from the same "date code" and "line #
I hope that this makes sense. If there are any questions or it would be easier to see the database let me know. Thanks for your help