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

Problem with Boolean from ODBC

Status
Not open for further replies.

MJSQA

Technical User
Nov 15, 2001
30
US
I am connecting to a database via ODBC. One of the fields that I am checking for criteria is a boolean. Crystal is seeing the results of this field from every record as false when in fact most are true. I pulled up the data with MS Access using the exact same ODBC driver and I am seeing correctly which ones are true and which ones are false.
I have accessed the same database previously with Crystal using the same ODBC driver but a different table and had no problems with a boolean field.


Side Question: Does anybody know how to select records using criteria based on a memo field? Crystal is not letting me do that.
 
This msg isn't a solution to the problem described, but a similar encounter with boolean/bit data types in SQL Server 7.0 via ODBC. The problem surfaced when I changed data source from OLEDB to ODBC. No other changes to the report or sprocs were made.

My sproc evaluated a bit input parm, but always evaluated false. I debugged my code to check the report's parm value and even used SQL Server Profiler to examine the DB calls. Both showed True and 0x1 respectively, the correct values.

The solution was that I had to reverse the logic from:

IF @Switch = 1

to

IF @Switch IS NULL SET @Switch = 0
...
IF @Switch <> 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top