Results 1 to 2 of 2
  1. #1
    Join Date
    May 2012
    Posts
    4

    Unanswered: convert number value to currency format with thousands separator commas

    Hi!

    I would like to ask if there is a way to select a number value and convert it to currency format.

    Ex. Select id, amount from deposit where id=1;

    current output:
    ID AMOUNT
    1 9800.00

    Is there a way to convert the output to "$9,800.00"?

    Thanks!

  2. #2
    Join Date
    Jun 2012
    Posts
    15
    Hi Brichigo,

    try this!!!

    declare @var varchar(50),
    @dpid int
    select @dpid=id, @var=amount from deposit where id=1;
    select @var = "$" + @var
    print " %1! %2!",@dpid,@var

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •