formatting numeric value to char with special displaying value

  • Hello comunity

    i need to transform a numeric value to char value but with a specific format:

    ex: my numeric field value = 12200.25

    with cast('12200.25' as char) the result is 12200.250000

    i need this : 12.200,25

    in VFP i have STRTRAN() function but not in SQL

    Someone could give me an ideia

    Many thanks

    Luis Santos

  • select replace(

    replace(

    replace(

    convert( varchar(16), cast(1234.20 as money), 1 )

    ,'.','!')

    ,',','.')

    ,'!',',')

    seems like a candidate for a UDF.

  • Hello Antonio

    Thanks for your reply they work fine

    Luis Santos

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

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