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!

SQL syntax in RecordSelectionFormula !!!!HELP!!!!!

Status
Not open for further replies.

Yioula

Programmer
Dec 12, 2001
2
GR
Through Visual Basic 6 I pass dynamically the RecordSelectionFormula for a report(made with Crystal Reports 8.0.1.0) which connects to an Oracle 8 database. Everything works fine! BUT if i try to pass a RecordSelectionFormula like:
&quot;AND ({ACTIVECUSTTRADEBUY.COUNT} <> 0 OR {ACTIVECUSTTRADEBUY.VALUE} <> 0 OR {ACTIVECUSTORDBUY.COUNT} <> 0 OR ACTIVECUSTORDBUY.VALUE} <> 0)&quot;, I get through my application, a Crystal Report Database Error:&quot;ORA-00907 right parenthesis missing&quot;.
When I debug my VB code and transfer the RecordSelectionFormula string in Crystal, it works fine! Moreover, the SQLQuery for this string, as generated in Crystal also works fine! (i run it directly on Oracle through SQL plus too, no prob!) I think i'm driving insane, so here comes the question: is there any know problem concerning some specific &quot;sql&quot; syntax in the RecordSelectionFormula? (don't ask why i have to use this type of &quot;AND...(criteria OR criteria OR...)&quot;, i just have...).Any ideas will be very very much appreciated. Help please! Thanks a lot :-(
 
May be off the wall but try enclosing each OR condition in parents eg:
(({ACTIVECUSTTRADEBUY.COUNT} <> 0) OR ({...} <> 0) OR ({...} <> 0))

I hope I got the number of parents right.
 
I have tried this along with anything else u can imagine as far as syntax is concerned. Anyway, the thing is that i captured tha runtime error (at last!) and i looked it up in Crystal Technical support just to get the answer: &quot;It's a known issue and has been tracked&quot;!(So, i gave up, and have altered my data source (created appropraite views to fetch the exact results as wanted).
For history, the runtime error is: Error -2147192179 (8004728d).
Anyhow, thanks a lot csm2, i appreciate it :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top