Haslett, Andrew
andrew.haslett at ilc.gov.au
Wed Oct 29 17:17:53 CST 2003
I'd say its the opposite. Its something that WILL work in an ADP, not using native Access SQL. -----Original Message----- From: John Colby [mailto:jcolby at colbyconsulting.com] Sent: Thursday, 30 October 2003 8:48 AM To: Access Developers discussion and problem solving Subject: RE: [AccessD] brain farts James, I kinda came to that conclusion. This is a shining example of the kinds of things that require conversions in order to work with ADPs. John W. Colby www.colbyconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of James Barash Sent: Wednesday, October 29, 2003 3:38 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] brain farts John, As far as I know, you cannot use bitwise functions in an SQL statement. You need to create a function to do the comparison. For example: Public Function BinaryOr(ByVal val1 As Long, ByVal val2 As Long) As Long BinaryOr = (val1 Or val2) End Function Create one function for each binary comparison you need or you could create one function and pass the operator you want to use. Hope this helps. James Barash -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, October 29, 2003 2:12 PM To: AccessD Subject: [AccessD] brain farts Folks, I'm trying to do boolean operations in a query. I have a table with bit mapped fields such that the long integer has bits "on" or 1 in specific circumstances. Now I want to OR in other numbers in SQL. I have a SQL statement that looks like: SELECT MsysForms.FRM_GroupOpen, ([MsysForms]![frm_GroupOpen] Or 1) AS NewVal FROM MsysForms; regardless of the value contained in the field frm_GroupOpen, the NewVal is always -1 for an OR or an AND of any other value, and 0 for an XOR. If I have a 4 in the field, 4 OR 1 should give me 5, but it is giving me -1. I believe it is "interpreting" it and saying it is true. But why? John W. Colby www.colbyconsulting.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com IMPORTANT - PLEASE READ ******************** This email and any files transmitted with it are confidential and may contain information protected by law from disclosure. If you have received this message in error, please notify the sender immediately and delete this email from your system. No warranty is given that this email or files, if attached to this email, are free from computer viruses or other defects. They are provided on the basis the user assumes all responsibility for loss, damage or consequence resulting directly or indirectly from their use, whether caused by the negligence of the sender or not.