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

parameter - in query does not show when used in report

Status
Not open for further replies.

Pluck

Programmer
Apr 26, 2003
16
0
0
US
I created a new query using the query designer. It has one parameter. WHen I run in the query designer it works just fine. I then saved the .qry

When I create a new crystal report 8.5 using this query the parameter does not show up anywhere!&$*(&$

Any idea's as to what I am doing wrong.

I am going against a sybase database.

I know I could make the query a stored procedure and it would work fine. But... I am trying to do a work around to a situation where there is a mortitorium on new stored procedures but NOT new reports. I am trying to backdoor the system. Once the mortitorium is over I would make it a stored procedure.

Any help would be appreciated.
 
Avoid using the query designer, it's a dying breed and just adds in a layer.

Add in the tables and set the joins, add in your parameter, and you should be fine.

If you have problems passing the SQL to the database (check the Report->Edit Selection Formula vs. the Database->:Show SQL Query), post what you've created in the record selectionm formula.

-k
 
Thanks, I agree. I do not have the code at home. I am unable to join the tables to get what I need. This is the situation.

table 1 has 4 rows. key value to row 1 = A, row 2 = B, row 3 = C, and row 4 = D

Table 2 has 40 rows

35 rows where key to table 1 = A
2 rows where key to table 1 = B
2 rows where key to table 1 = C
1 row where key to table 1 = D

in other words a one to many relationship

Table 3 has two columns. Basically, this table shows potential linkages between A, B, C, and D.

For this example Table 3 has the following value

row 1 ---- xyz, A
row 2 xyz, B
row 3 xyz, C
row 4 xyz, D


User may key in an A and will be returned 35 rows
or they may key in a xyz which would return 40 rows.
entering a D would return 1 row.

BTW - you will never find xyz on table 1. So if the value being passed is found on table one I know not to go to table 3. If the value is in column 1 of table 3 then I know I have a combination of rows.

I probably have made this sound trickier than it really is. It is actually very straight forward and have the sql ready to be made into a stored procedure which can't happen until the mortitorium is over.

I will try to copy the sql into the sql designer to see if it works there. Funny, but I didn't think it would so I didn't even try.

So in a nut shell

Table 1 has unique values
Table 2 has many values
Table 3 is a combination type of table. It may or may not have any values in it. It's key is not found on either table 1 or 2.

----

BTW - do you know why the parameter in the query I created doesn't show in the new report. Original question ;-)
 
You can't copy the SQL in, however you can modify the existing From, Where and Order by portions of the query.

Perhaps you'd be better served to post your SQL, text descriptions leave too much to the imagination.

The 3rd table didn't make sense to me, the rest is simple.

If you post example data, showing pertinent column names, and the expected output, you may find that someone has a simpler approach to your problem.

-k
 
hi...

I too have same problem ..thats using parameter for a query using stored procedure...can u tell me the procedure to use the procedure with argument as parameter in a query.. I am also using sql designer with crystal 8.5 and interbase.

please give the steps to do that
 
I contacted Crystal today about this issue. Basically, they said what synapsevampire said above. Don't use their product.

I went over what it is I am trying to accomplish and said I needed to do it in a stored procedure - which is what I was trying to get around.

anyway...

I am not sure of your question. If you are trying to use a parameter in a query, Crystal says it may or may not work but bottom line is you shouldn't even try. Get version 9 was their suggestion.

If you are trying to do something else let me know and I will try to help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top