Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Convert Excel Formula to SQL code Expand / Collapse
Author
Message
Posted Friday, July 26, 2013 5:23 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, October 28, 2015 11:53 AM
Points: 58, Visits: 219
How do I convert this excel formula to SQL code?

=IF(T2<R2,T2*O2,MIN(T2-R2,S2-R2)*O2)


Thanks,

Helal
Post #1478249
Posted Saturday, July 27, 2013 2:06 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Saturday, April 9, 2016 11:35 AM
Points: 878, Visits: 841
CASE WHEN T2 < R2 THEN T2
WHEN T2 < S2 THEN T2-R2
ELSE S2
END * O2



Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Post #1478274
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse