Thank You Guys.
Gary yours is also an excelent solution.
What i found challenging (because my lack of practice & formal training in these fine tool) was the use of the variables and passing them trough different formulas. I was trying to implement a "bubble sort".
Yes there is a lot of calculations, and i did it just to avoid them in the report since i'm having hard time with it! , the data is comming from a machine and is not formated.
There is No error it just basically brings only the first SELECT of the query....
It didn't work .... :[
the database engine is MYSQL 4.1.13
and i'm using ODBC to connect to it. (posible problem?)
the result query is ONLY THE FIRST SELECT.
here is a portion of your suguested query
(SELECT Timestamp,
Machnumb,
bpcsshopno2*10000+ bpcsshopno1 as ShopOrder,
currentcavs...
yes your right ... i'm not been carefull on my post
Shift # x
Mach#
topreason1,topreason2,topreason3,topreason4,topreason5
167 0, 0, 0, 0, 0
topreason1,topreason2,topreason3,topreason4,topreason5
180 0, 0, 0...
I'm sorry i need also the head of the column
shift 1 (6:00am-5:59pm)
Mach# topreason1,topreason2,topreason3,topreason4,topreason5
167 0, 0, 0, 0, 0
180 0, 0, 0, 0, 0
300 1343, 366...
after i read again my reply i figure out that i was not clear
this is a log
the timestamp field is the when the entry to the table was done
machnumb= machine number
the rest are the cumulative minutes (mm.m) that the machine stop. each column represent a reason.
so in one day a machine...
I don't know if this sample will work but here is the data.
so...
1st thing is the date group: i ask for the datetime1 and datetime2.
2nd I group data by machine
3rd I get the maximun value for each column for each group
and finally my problem: show only the 5 biggest values for each...
Here is the seudo structure:
id;timestamp;machinenumber;uptime;downtimereason1;downtimereason2;...;downtime reason17
they are minutes but they are cumulative at the en of the day al of them return to zero and start again,
so far..... i can create the groups base selected by dates and/or...
I'll start by saying that i'm a newbie.
current conditions:
crystal 9.0
1 table (is a log)
17 of 30+ columns represent time under diferent conditions
Problem:
bring the top 5 five values and id from wich colum came.
Any sugestions?
Were should i start?
Thank You
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.