Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Base 10 number to binary string?

Status
Not open for further replies.

DavidMarcus

Technical User
Feb 2, 2002
8
US
We have a field that records the days of the week to which something applies. The field is stored as a number in the range 0 - 127. The field is the base 10 representation of a seven character binary array where each character reprsents a day of the week. For instance,

binary 1000001 means Sunday and Saturday and is stored in the database as 65. Binary 1111111 means every day of the week and is stored as 127.

How can I convert from the decimal number (e.g. 65) to a 7-character string (e.g. 1000001) ?

I've got the reporting problem solved by brute force right now, but I'd like a more elegant solution for future use.
I am using Crystal Reports 8.0 and using RDC to embed them in our applications.

David Marcus
GMT Corporation
 
Er... never mind.... I read the answer two threads down.

Ooops! I am using Crystal Reports 8.0 and using RDC to embed them in our applications.

David Marcus
GMT Corporation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top