Yves, you are truly a life saver! I started my project using postgreSQL, and transferred it toSAPdb because of PostgreSQL's issues with boolean variables. I was tearing my hair out at the thought that there ware similar problems with SAPdb.
Once again, thank you! I was imagining all sorts of nasty workarounds... :-) Regards Alan Graham and if you're ever in Perth, Oz, the beer's on me! On Mon, 2003-07-21 at 22:39, Yves Trudeau wrote: > Hi, > you have to use: SELECT name FROM customer WHERE inactive=cbool(False) > > Good luck > > Yves > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Alan Graham > Sent: 20 juillet, 2003 10:04 > To: '[EMAIL PROTECTED]' > Subject: Access97 via ODBC, boolean query > > > I've got a query of the form > SELECT name FROM customer WHERE inactive=False > in Access 97. This worked fine in Access, and works in the SQL studio > to SAPdb (Version 7.4.3). From Access to SAPdb using ODBC, I get > Error 8006 Data types must be compatible. > > The SQL trace of the ODBC driver shows that the boolean test is being > passed through as '... "INACTIVE" = 0'. This suggests that it's an ODBC > problem. Similarly, inactive <> true is passed through as NOT INACTIVE > = 1. > > I'm using version 7.4 of the ODBC driver, with the 7.3 version of the > driver, to avoid the Unicode bug with the ODBC driver (Ie, that 7.4 only > supports Unicode, win98 doesn't support Unicode, and 7.3 doesn't work > with MS Access). I've tried both INTERNAL and ANSI modes of the ODBC > driver, with the same result, ie, False is transfered as '0' and True as > 1. > > I've googled for this, and found a few people with the same problem, but > no answers that work for me. I got excited about the answer that > suggested that Access doesn't like nulls in Boolean fileds, but I don't > have any nulls. All tuples have the values TRUE or FALSE. Then I found > the suggestion that Access wasn't recognising the column as a type > 'Yes/no'. I checked that, and it is. The column is handled correctly > on forms, etc, as a checkbox where appropriate. It only seems to be a > problem in the where clause. > > Can anyone shed any light on this? > > Regards > > Alan Graham > > _______________________________________________ > sapdb.general mailing list > [EMAIL PROTECTED] > http://listserv.sap.com/mailman/listinfo/sapdb.general > _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
