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

Problem With Parameter and Overwriting SQL Query

Status
Not open for further replies.

Sambo8

Programmer
May 10, 2005
78
NZ
Hi All,

I've overwritten my sql query so I can include where not in sub-select.

However I want a field in the select to = ?parameter and also a field in the sub-select to < ?parameter. (same parameter in both cases) When I try to do this it SQL adds both paramaters in again and causes multiple errors.

any ideas?

Many thanks

Sam
 
Try posting technical information in lieu of descriptions:

Crystal version
Databsae/connecvity used
Example data
Expected output

If you mean that you're altering the Database->Show SQL Qeury in versions 8.X and below, then you need to be careful with this, and understand that this is generally a bad idea.

If you're altering the Add Command object in CR 9 or above, then the parameters should be created in the Edit Command while pasting in the SQL and removed from the record selection formula as well as deleting the statndard Crystal parameters frist.

Why not post requirements instead of forcing people here to try to use your method?

-k
 
Hi,

Sorry for the lack of information,

I'm using 8.5 connecting through ODBC to Oracle database. I've updated the sql to show a

select id from blah where field = ?parameter and id not in (select id from blah where field < ?parameter).

So what I want to do is show a list of id's and names where they don't already exist with a younger record than the one selected by the parameter. I thought about using a subreport but don't know how id link it???

Grateful for any ideas?

many thanks

Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top