Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: Monday, August 24, 2015 11:02 AM
Points: 52, Visits: 200
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, August 29, 2015 2:48 PM
Points: 855, Visits: 807
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