Hello, I have a string of charachters that represent hex octets to make up a date. The following string will equate to October 2, 2006 12:00:03 240902000003 The first octet, 24 is the hex value for 36. The dates for this particular form of torture begin at 1970 and this represents 36 years after 1970 or 2006. Back to the problem. When I go to create a function in SQL 2000 I separate out the 24, append 0x to the front and convert it to varbinary. I expect the system to come back with 0x24, but no...I get 0x30. declare @binYear varbinary(1) declare @intYear int declare @strYear nvarchar(4) declare @strValue nvarchar(50) set @strValue = '240902000003' --leaving the N out for Unicode does not help...same results Set @strYear = N'0x' + Left(@strValue, 2) --this prints out '0x24' Print 'Year String = ' + @strYear Set @binYear = CAST(CAST(@strYear AS nvarchar) AS varbinary(1)) --this is what I convert SELECT CAST(CAST(@strYear AS nvarchar) AS varbinary(1)) --this is what I want to do SELECT CAST(CAST(0x24 AS nvarchar) AS varbinary(1)) --This is in desperation... select Cast(Cast(substring('0x24',1,4) as nvarchar) as varbinary(1)) So...I run the select statement expecting to see 0x24 and see 0x30. Odd thing is, I seem to get that with any number I use as long as it's in single quotes. '0x1A' = 0x30 and it goes on and on. I know I'm probably missing something simple. Basically I want to get 36 out of 24 hex and this is driving me nuts. Any help would be appreciated. I'm trying to avoid having to write a VB app to convert these logs.