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
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, November 12, 2014 12:04 PM
Points: 29, Visits: 129
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: Today @ 3:28 PM
Points: 817, Visits: 743
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