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

Filtering with RecordSelectionFormula

Status
Not open for further replies.

KPharm

Programmer
Feb 1, 2001
38
US
I'm using vb6, cr7 (cpeaut32.dll), and Oracle 8. Crystal will always bomb once (-2147417848 Automation Error) when performing the following filtering on a NUMBER field:

Field Type
QUERY_TO_SID NUMBER

with the filter being set as:

sCriteria = sCriteria & "{TABLE1.QUERY_TO_SID} = 21"

If retried immediately it works great. Being able to successfully use the above criteria is very important because instead of returning 100,000 records back from Oracle, it may only send 2 records. The only way that I can get this to not bomb is to set the filter to:

sCriteria = sCriteria & "ToNumber({TABLE1.QUERY_TO_SID}) = 21"

but this will pass back the 100,000 records then perform the filtering, which is unacceptable.

Any thoughts?
Chris
 
Have you tried verifying the database from within Crystal Reports? The report may think the field is a string (perhaps you have changed the field type since creating the report). Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
I double-checked. Verify said all was well, and right clicking on all of the number fields and hitting Format showed Crystal treating them as a Number...
 
That is weird. Have you checked to see if the Crystal Decisions site has a later p2sora8.dll, or see if switching to an ODBC driver helps?
A painful solution would be to plug your filter directly into the SQL statement - this is more tedious to code and maintain though. Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top