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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Urgent Help max of hexadecimal

Author  Topic 

gk_sql
Starting Member

9 Posts

Posted - 2006-07-12 : 18:59:39
Hi,

I want to take max of Id column in hexadecimal. For eg:

11100000 A
11110000 AB
11111000 ABC

FOR ABCD the ID should be 11111100

Please advise on this problem! Thanks.

GK

gk

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2006-07-13 : 06:39:11
gk - I don't understand what you want. Do you want to convert between different bases (base 16 and base 2)? Where does the max come in?

I don't understand how 11100000 relates to A, or why the ID should be 11111100 for ABCD.

Can you give more information...


Ryan Randall
www.monsoonmalabar.com London-based IT consultancy

Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-07-13 : 06:53:02
Not really sure what you want... Is it something like this ?

declare @table table
(
id varchar(8),
col varchar(10)
)

insert into @table
select '11100000', 'A' union all
select '11110000', 'AB' union all
select '11111000', 'ABC'

declare @max varchar(8)
select @max = max(id)
from @table

select '1' + left(@max, 7)



KH

Go to Top of Page
   

- Advertisement -