Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

comparing across multiple decimals

$
0
0

I'm trying to write a report on the versions of software we have installed and whether what's installed is up to date, ie, newer or older than our baseline.

declare @var1 varchar(20) = '11.8.800.94'
declare @var2 varchar(20) = '11.8.800.175'
select case
when @var1 > @var2 then '1st'
when @var1 < @var2 then '2nd'
end as test

Query returns '1st'; I want '2nd'.

Any ideas how?


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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