troubleshooting Question

Simplified Query

Avatar of rfl
rflFlag for Portugal asked on
Microsoft SQL ServerSQL
14 Comments1 Solution95 ViewsLast Modified:
Hi,

I have a table in a database to calculate a factor. I made a calculation through code vb and datatables, but I think it could simplify a lot if through SQL.
I would like someone to give me some help to simplify with SQL.
In this table for a date, color, density, type and location i need find factor. While date, type and location the values are pre-defined (Location: 01,05,08 and type: type 1, type2), color and density is mesuared (the value changes).


Example
Date: 02/05/2017
Color: 2,13
Density: 4,25
Type: Type1
Location: 05
The factor is 0,06

Example
Date: 02/05/2017
Color: 2,13
Density: 4,81
Type: Type1
Location: 05
The factor is 0,0675

best regards
Attached example table


table.xlsx
ASKER CERTIFIED SOLUTION
Shaun Kline
Lead Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros