Integer data type -> binary coded decimal
From: Ali Cox (REEMOVETHIIS_alastair_cox_at_btinternet.com)
Date: 03/20/04
- Next message: Tom Moreau: "Re: Querying multiple SQL Servers"
- Previous message: David Portas: "Re: Querying multiple SQL Servers"
- Next in thread: Joe Celko: "Re: Integer data type -> binary coded decimal"
- Reply: Joe Celko: "Re: Integer data type -> binary coded decimal"
- Reply: Steve Kass: "Re: Integer data type -> binary coded decimal"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 20 Mar 2004 03:56:06 -0800
I'm trying to create the binary coded decimal representation of a decimal integer, to be used/cast in a varchar concat with others of the same.
Basically this is to decode MIME base64 encoding, and I have hit the proverbial brick wall with this part of it.
EG. 34 (dec) is 100010 (bcd)
I need to take the int 34, and change to the string '100010'.
I hope there is a neat way to do this, perhaps mathematically?, as I don't really want to use a case statement. I can't see any datatype in SQL2K (Intel x86) that I can use.
Thanks,
Ali.
- Next message: Tom Moreau: "Re: Querying multiple SQL Servers"
- Previous message: David Portas: "Re: Querying multiple SQL Servers"
- Next in thread: Joe Celko: "Re: Integer data type -> binary coded decimal"
- Reply: Joe Celko: "Re: Integer data type -> binary coded decimal"
- Reply: Steve Kass: "Re: Integer data type -> binary coded decimal"
- Messages sorted by: [ date ] [ thread ]