I'm new to SQL and will be running what seems to me like quite a complex set of queries.
I'm sorry for what will probably be quite a confusing explanation.
I have a database which keeps track of measurements on items. I want to be able to extract all of the information for the last 30 items and analyse the data.
For each measurement I want to know the maximum and minimum value recorded, the number out of tolerance, the percentage of features out of tolerance in the day, the number of parts in a day with no features out of tolerance, the time between each item being measured as well as outputting all of the data and colour coding cells depending on whether they're in tolerance.
Is any of this possible, and if so how could i do it?
I'm trying to figure out the tolerance bits and have:
_______________ _______________ _______________ _________
SELECT COUNT (DISTINCT Serial_No)
FROM Database
WHERE Feature = 'feature1' AND Actual BETWEEN Upper_Tol AND Upper_Tol - ((Upper_Tol - Lower_Tol)/4) OR Feature = 'feature1' AND Actual BETWEEN Lower_Tol AND Lower_Tol + ((Upper_Tol - Lower_Tol)/4)
ORDER BY Date, Time
_______________ _______________ _______________ _________
However I don't know how to use Top 30 with this query, nor do I know if this would work.
Thank you for your help on any part of this task.
I'm sorry for what will probably be quite a confusing explanation.
I have a database which keeps track of measurements on items. I want to be able to extract all of the information for the last 30 items and analyse the data.
For each measurement I want to know the maximum and minimum value recorded, the number out of tolerance, the percentage of features out of tolerance in the day, the number of parts in a day with no features out of tolerance, the time between each item being measured as well as outputting all of the data and colour coding cells depending on whether they're in tolerance.
Is any of this possible, and if so how could i do it?
I'm trying to figure out the tolerance bits and have:
_______________ _______________ _______________ _________
SELECT COUNT (DISTINCT Serial_No)
FROM Database
WHERE Feature = 'feature1' AND Actual BETWEEN Upper_Tol AND Upper_Tol - ((Upper_Tol - Lower_Tol)/4) OR Feature = 'feature1' AND Actual BETWEEN Lower_Tol AND Lower_Tol + ((Upper_Tol - Lower_Tol)/4)
ORDER BY Date, Time
_______________ _______________ _______________ _________
However I don't know how to use Top 30 with this query, nor do I know if this would work.
Thank you for your help on any part of this task.
Comment