Gowtham Ramamoorthy
asked on
Conversion failed when converting the varchar value '115,89' to data type int.
Hi,
How to resolve the above error for the below code description ?
Begin
Declare @InputUnit AS Varchar(256)
Set @InputUnit = (Select Query which returns the value 115,89)
SELECT ................. left join.....
WHERE
Dimension_ID = 8155 AND Geography_ID = 3346 AND DVid =2 AND Collection_ID=5 ANDUnit_ID1 IN (@Inputcount)
END
How to resolve the above error for the below code description ?
Begin
Declare @InputUnit AS Varchar(256)
Set @InputUnit = (Select Query which returns the value 115,89)
SELECT ................. left join.....
WHERE
Dimension_ID = 8155 AND Geography_ID = 3346 AND DVid =2 AND Collection_ID=5 ANDUnit_ID1 IN (@Inputcount)
END
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Is there a typo in your question?
You're declaring @InputUnit variable and then using @Inputcount in your SELECT statement.
You're declaring @InputUnit variable and then using @Inputcount in your SELECT statement.
>(Select Query which returns the value 115,89)
So you're trying to assign a numeric value '118,89' to the varchar @InputUnit.
The data types have to be the same, so you'll have to CAST the '118,89' as a varchar, i.e.
Open in new window
Also, tell us if 'the value' has a column data type of varchar, numeric, or int.