Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Procudtion standard rate query

Status
Not open for further replies.

mp2admin

Programmer
Apr 17, 2008
10
US
HI,
I am trying to write a query that would display the current rate at the minute based on which meeting time is occuring. I could have up to 3 meetings scheduled per shift.

My goal was trying to have a qry that shows the current production gaol based on current minute in shift and based on which meeting is occuring.

"shift start & end" = 07:45 - 15:45
"23" = the current scheduled downtime minutes for this machine. The "current scheduled downtime minutes" is summed in coldfusion as the meeting time happens.
"480" = shift minutes
"1218" = current production on machine
"standard rate" = 192000

My current query..
SELECT ABS(Standard_Rate / 480 * 23) AS rate,
ABS(1218 / (Standard_Rate / 480 * 23) * 100) AS eff
FROM tbl
WHERE (RIGHT(Name, 2) = '04') AND (Name LIKE '%lbr%')
ORDER BY Name


Db table where schedule is stored
start_date end_date start_hour start_minute end_hour end_minute
12/4/2013 12/4/2013 8 8 9 45
12/4/2013 12/4/2013 12 0 13 0
12/4/2013 12/4/2013 15 30 15 45
 
I don't understand why you're multiplying the rate per minute by the number of minutes of downtime. Oh, maybe I do, but I think that's backwards. If you want to know the actual rate, should the multiplier by (60-downtime)?

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top