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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Data Manipulation and outputs

Status
Not open for further replies.

Ca1icoJack

IS-IT--Management
Nov 27, 2008
36
GB
I'm completely new to SQL and would like to know exactly what I can do with it.

I want to be able to extract a load of data for a feature, calculate some new values, order the data by date and take the most recent 30 values. Then repeat this for each feature.

An example of the value I'd want to calculate is the percentage of features for a particular item out of tolerance for the day. So if two items are measured each with 13 features and two wrong on the first and one on the second the value would be 300/26.

I'd then want to be able to create colour coded tables with the data (of a specific format I'm currently manually creating)

Is it possible to do all of this directly with SQL manipulation. Or will I have to pull the data out of the database and manipulate it with Excel?

I hope the explanation of what I want makes some sense.
Thanks very much
 
Sorry, forgot to mention we runs on Windows 2000.
 
I think all you're describing is possible with T-SQL. If you divide your tasks into smaller steps, post your table definitions, some data samples and desired output, we would be able to help you with the code.
 
Okay, thanks for the help.

I'm not able to upload anything. Uploading files is blocked here. However, I'll list what I can.

If anything doesn't make sense I'll attempt to explain what is needed.

The column headings I need are:

Measured_Date
Measured_Time
Serial_No
Feature
Nominal
Actual
Upper_Tol
Lower_Tol

The following headings go across from A13. Brackets contain the database column haeding calculations.

Upper Tolerance Limit (Upper_Tol)
Upper Warning (Upper_Tol - ((Upper_Tol + Abs(Lower_Tol)/4))
Target (Nominal)
Lower Warning (Lower_Tol + ((Upper_Tol + Abs(Lower_Tol)/4))
Lower Tolerance Limit (Lower_Tol)
Tolerance Range (Upper_Tol + Abs(Lower_Tol)

The following headings are downwards from G1

Date
Parts RFT
Num Feats
Feats Bad
Feats RFT
Avg Mins
Parts in day
Time
Serial Number
< Lower Tolerance
> Upper Tolerance
In "Warning" Range

Feature 1 is in G14 and successive features are on rows below this.

The columns going across contain the data for each serial number ordered by date and time.

I'm sorry that this is such a complicated way of explaining things.
 
I'll upload the files at some point later today if possible.

Is it possible to edit posts btw?
 
I think it's not possible to upload files here and also I don't think you can edit your post. The problem seems a bit more complex than I originally anticipated.

In addition to posting this problem here I suggest you to post this problem on website (you would have to become a member to participate in discussions).

You would be able to attach your file and edit your post as long as no one replied.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top