Is it possable to use bit comparing in SQL statements? If I use bit numbers(ie.. &H000001) for security permissions, how would I do a search for 2 different levels? I have about 5 different security settings that users can have. I need to do a search and retrieve anyone with any of these 5 settings. Any ideas for the sql?
I can find information about the basic comparisons and operations used in sql, but I don't see anything about bit comparison in sql.
here is an sql example
GROUP_MEMBER = &H000001
"SELECT MAX(username) as username, MAX(fname) as fname, MAX(lname) as lname FROM (groupmembers gm left JOIN users us ON gm.gmUserID = us.dbid) WHERE gmGroupID = " & groupID & " AND ((gmStatus and " & GROUP_MEMBER & " <> 0)" & " GROUP by gmStatus, gmStartDate"
This syntax will run, but it returns the wrong results.
Does this work in a sql statement?
((gmStatus and " & GROUP_MEMBER & " <> 0)
I can find information about the basic comparisons and operations used in sql, but I don't see anything about bit comparison in sql.
here is an sql example
GROUP_MEMBER = &H000001
"SELECT MAX(username) as username, MAX(fname) as fname, MAX(lname) as lname FROM (groupmembers gm left JOIN users us ON gm.gmUserID = us.dbid) WHERE gmGroupID = " & groupID & " AND ((gmStatus and " & GROUP_MEMBER & " <> 0)" & " GROUP by gmStatus, gmStartDate"
This syntax will run, but it returns the wrong results.
Does this work in a sql statement?
((gmStatus and " & GROUP_MEMBER & " <> 0)