Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 20764

how to convert varchar data type rows into money in sql server 2008 R2?

$
0
0

Hi ,

i got one requirement like - i need to convert var char data type column rows into money data type or int data.

when i used cast or convert function that time i am getting the below error

"Conversion failed when converting the varchar value '0.5' to data type int ."

Ex:


CREATE TABLE [dbo].[test](
[id] [int] NULL,
[amount] [varchar](50) NULL
) ON [PRIMARY]

insert test values(1,'0.5'),(2,0.4)

Expected output is:

id    amount

1       50.00

2       40.00

thanks in advance


franklinsentil


Viewing all articles
Browse latest Browse all 20764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>