Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 HEX to DEC

Author  Topic 

Dagmd
Starting Member

14 Posts

Posted - 2007-03-09 : 06:04:07
Hi,

I am wondering if it is possible to convert a hex value (to decimal) returned from a query so that it can compared to a decimal value within the same query?

Thanks

Talis

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-03-09 : 06:23:13
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61914&SearchTerms=hex,to,dec

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-09 : 06:39:42
[code]declare @a as tinyint,
@b as binary

select @a = 160,
@b = 0xa0

select @a,
@b,
case when @a = @b then 1 else 0 end[/code]

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Dagmd
Starting Member

14 Posts

Posted - 2007-03-09 : 13:20:39
Thanks
Go to Top of Page
   

- Advertisement -