I have a table where the version value's are nvarchar rather than integer so when I use a greater than statement it isn't pulling back the correct data
I am trying to convert the version to integer but am getting an error, please help
Declare @dversion int;
set @dversion = (select convert(int, displayversion) from Inv_AddRemoveProgram where DisplayName like 'Symantec Enterprise Vault%')
select distinct v1.name, v1.[user], t1.displayname, @dversion from vComputer v1
inner join Inv_AddRemoveProgram t1
on v1.Guid = t1._ResourceGuid
where t1.DisplayName like 'Symantec Enterprise Vault%'
and @dversion > '10.0.17573'
Error received: Msg 245, Level 16, State 1, Line 3 Conversion failed when converting the nvarchar value '10.0.17573' to data type int.
I also tried writing two simple queries to convert the version value in that table which also didn't work
select displayname, CONVERT(INT, displayversion) from Inv_AddRemoveProgram
Error: Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the nvarchar value '3.1.05160' to data type int.
select displayname, CAST(displayversion AS INT) from Inv_AddRemoveProgram
Error: Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the nvarchar value '3.1.05160' to data type int.