You must Sign In to post a response.
  • Category: SQL Server

    Amount should show with comma seprator

    select exptypeid,
    CONVERT(varchar, CAST(CAMOUNT AS money), 1) as CAMOUNT,
    CONVERT(varchar, CAST(PAIDAMOUNT AS money), 1) as PAIDAMOUNT,
    camount-SUM(ContarctAmountAfterpercentage-AdvanceAdjustment-ActualPayment) as remainingpayment
    from TBL_CONTRACT left join tbl_ContractAmountMileStone on
    tbl_ContractAmountMileStone.ContractId= tbl_contract.contractid
    --WHERE tbl_contract.CONTRACTID=@Id
    group BY camount,tbl_contract.contractid,TBL_CONTRACT.exptypeid,TBL_CONTRACT.contractorid

    In This Query I want to show amount with comma seprator, like CAMOUNT.
    but i do't know i can can put in this line for showing the Remaining Amount.

    camount-SUM(ContarctAmountAfterpercentage-AdvanceAdjustment-ActualPayment) as remainingpayment
  • #747537
    Use below SQL Script to get comma separated amount

    SELECT FORMAT(123456789, N'c', c.culture) AS some_currency,
    c.culture
    FROM ( VALUES ('en-US'),
    ('en-GB'),
    ('ja-JP'),
    ('Ro-RO'),
    ('hi-IN') ) C (culture);

    For more details go to the below URL
    http://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx


  • Sign In to post your comments