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

Need to Compare INT value with Hex value to see if Bit is on!

Status
Not open for further replies.
Oct 21, 2003
21
US
I am trying to replicate a SQL statement that compares an integer with a HEX field and returns a value (0 or other) if the bit is turned on or off -- itemtag is an integer
CASE
WHEN (wi.itemtag & CONVERT(int,0X8000)) <> 0 THEN 'Y'
ELSE 'N'
END


in an access query design view-- and am very stumped -- Any help would be great
 
So are you looking for a result like this

Int = 123
Binary = 1111011
YourConvertValue = YYYYNYY


You would probably have to send the integer value to a function that converts to a binary and returns Y's and N's if the bit is turned on or off.
Or am I completely off the charts here?

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top