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: 2 days ago @ 6:03 PM
Points: 50, Visits: 181
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: Monday, July 6, 2015 4:40 PM
Points: 853, Visits: 804
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