Monday, March 12, 2012

Hex

Is there not a function in MS/SQL to return the hex representation of a character?
HEX("A") = 41 for example.[un-sniped]
SELECT ASCII('A')
SELECT CHAR(65)
[/un-sniped]

I swear your post beat me in, now it's the other way around...

ORDER BY PostDate|||select cast(ascii('A') as varbinary)

To flip to integer:

select cast(0x0000002C as int)

To convert back to character:

select char(cast(ascii('A') as varbinary))|||Thanks so much!

No comments:

Post a Comment