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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binary logic holding data! 1

Status
Not open for further replies.

mart10

MIS
Nov 2, 2007
394
GB
I am using CR 10

Trying to extract data from a field holding data using bianary logic (please dont ask me why!)

So I have

Service Index
1 1
2 2
3 4
4 8
5 16
6 32

I need to extract which services are being used dependant upon the value of the index and this could obviously be multiple services. Dont have a clue how to go about this

eg Service 3 and 5 being checked would give output 20 (4+16)

If I get this working then I then need to assign different names to the services

can anyone help, it looks like I need to build some sort of logic that will create a range of possible outcomes.
 
I have had some help from the software vendor you designed this lousy db

I have to create the following type formula for each required 'field' :

If (({T320.F320I2}\(2^0)) mod 2) = 0 then "" else "Y" for service 1

If (({T320.F320I2}\(2^1)) mod 2) = 0 then "" else "Y" for service 2

etc

Hope this of use to others who ever come accross this type of data structure
 
Thanks for the tip. I mulled over this one since was posted. I figured there was a way, I just couldn't come up with the math.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top