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
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, March 20, 2014 8:33 PM
Points: 24, Visits: 112
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


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: 2 days ago @ 4:43 AM
Points: 756, Visits: 631
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