INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Passing parameter to sub-report the uses a SQL command.

Passing parameter to sub-report the uses a SQL command.

(OP)
I have a report that contains one sub-report. Both the main report and sub-report are using SQL commands. The two reports use the same query in their respective commands. The main report points to a production server and database and the sub-report points to a test server and database. I do this so that I can easily compare the differences between the results of the test data to those of the production data.

In the main report there is a date parameter. I want to pass this date parameter to a parameter in the sub-report so they both have the same input. At this point I have been unsuccessful in passing the parameter to the sub-report.

Any thoughts on how to accomplish this would be appreciated.

Regards,

Ralph

RE: Passing parameter to sub-report the uses a SQL command.

The way that I do it is to have the same parameters in the main report and the sub-report. Then link the parameters. This has always worked for me.

RE: Passing parameter to sub-report the uses a SQL command.

(OP)
How are you linking the two parameters? I tried doing that in the record selection formula but I was still presented with the parameter twice and the value was not passed from one to the other.

Could you provide a screen shot of how you did this?

Thanks.

Ralph

RE: Passing parameter to sub-report the uses a SQL command.

In the main report, go to edit->subreport links. Move the main report parameter to the right, and then in the bottom left, use the drop down to select {?yourparameter}, not the default {?pm-?yourparameter}.

You should not be adding anything to your selection criteria in the main report. All parameters should be created and used within the command. Otherwise the report will process locally and be much slower. Be sure to remove anything you added earlier in the selection formula area.

-LB

RE: Passing parameter to sub-report the uses a SQL command.

(OP)
Thank you.

Your suggestion did the trick.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close