I have a field in a table as nvarchar(10), which is used to store a value in pennies. For example, $23.50 is stored as开发者_JS百科 "2350".
I need to return this value to the program in Money format. How would I do that in the Select statement?
SELECT CAST (IntAmount / 100.00 as MONEY)
cast(cast (pennies as numeric(16,2))/100 as money)
Select convert(money, field/100, 0) from table
精彩评论