August 7, 2007 at 7:35 am
Good Morning Everyone,
I have stored salary amount as varchar in my table and now i need to convert into currency format with "$" sign. I have wrote following funciton to convert the datatype
'$'+ Convert(varchar,Convert(money,Salary),1)
This converts 50000 into $50,000.00
Now i need to get rid of decimals at the end so that $50,000.00 will display as $50,000
What function do i need to use to get rid of decimals ?
Thanks
August 7, 2007 at 9:49 am
Firstly, why are you storing it as a number? Why not store it the correct way and format ini the end app???
Why store it as a string?
If you must...
SELECT
left('$50,000,000.00', Len('$50,000,000.00')-3)
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
August 7, 2007 at 3:06 pm
i agree why don't you format it in the front end
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply