format "Floor" should change to Round

  • Hi,

    Need to get the integer values in results.
    i am using below FLOOR function , but i want to get the values to be rounded.

    Query:
    REPLACE(FORMAT(FLOOR(CASE WHEN sum(CASE WHEN a.LOANAMOUNT IS NOT NULL THEN a.STR_WEIGHT ELSE 0 END) = 0 THEN 0
                    ELSE sum(CASE WHEN a.LOANAMOUNT IS NOT NULL THEN a.LOANAMOUNT * a.STR_WEIGHT    ELSE 0 END) /
                      sum(CASE WHEN a.LOANAMOUNT IS NOT NULL THEN a.STR_WEIGHT ELSE 0    END)
         END),'C'),'.00','') AS AMOUNT

    Result:

    $13,497.50
    $12,241
    $21,295.75
    $13,916.17
    $12,456.96
    $18,487

    Required result:

    $13,498
    $12,241
    $21,296
    $13,916
    $12,457
    $18,487

    Any help please.

  • Use ROUND?
    SELECT Amount,ROUND(Amount,0) AS rounded
    FROM Green;

  • pietlinden - Monday, October 9, 2017 7:42 PM

    Use ROUND?
    SELECT Amount,ROUND(Amount,0) AS rounded
    FROM Green;

    thank you.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply