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

Format of number Expand / Collapse
Author
Message
Posted Tuesday, August 12, 2014 4:11 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 9:23 AM
Points: 234, Visits: 475
Hi,

When I run the following part of code - Which works out a weekly rent from a monthly one

WHEN Loc.[rent-group] = 'F' THEN COALESCE(ARENT.[NET-AMT]*12/52,0) /*To work out weekly rent on monthly run*/

I'm getting the result coming back as "114.230769" as an example.

How do I get it to come back as - "114.23"?

Thanks
Post #1602206
Posted Tuesday, August 12, 2014 5: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 @ 1:37 AM
Points: 996, Visits: 3,089
WHEN Loc.[rent-group] = 'F' THEN COALESCE(CAST(ARENT.[NET-AMT]*12/52 AS DECIMAL(10, 2)),0) /*To work out weekly rent on monthly run*/





The SQL Guy @ blogspot

@SeanPearceSQL

About Me
Post #1602221
Posted Tuesday, August 12, 2014 6:18 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 9:23 AM
Points: 234, Visits: 475
Thank you very much. Just what I was after.
Post #1602239
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse