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)
 dec to hex conversion

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-05-03 : 10:44:00
mustafa writes "Dear sir

Hi I want to convert 10 digit decimal number to heaxdecimal number i tried with hex function but it take only upto 9 digit dec no . for 10 digit no it throw an error "overflow". i am using vb as my programing language.
If anybody knows how to do it please let me know either through vb or through sql server 2000.


thanks"

gpl
Posting Yak Master

195 Posts

Posted - 2004-05-03 : 10:48:02
divide your number by 16, convert that to hex
then take your number mod 16, convert the result to a single hex character and append it to the result in the first step
Graham
Go to Top of Page
   

- Advertisement -