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.

Students Click Here

Table name parameter

Table name parameter

Table name parameter

I would like to use a parameter for the table name. I have a database that creates tables based on a date and location and sets the table name to this. This way, there will be several new table names created every month. The fields are always identical. I therefore need the table name to be sent into CR via a parameter. I do not create the reports with any programming outside of CR. Is there any way to use a parameter for the table name?

Replies continue below

Recommended for you

RE: Table name parameter


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?"

RE: Table name parameter

If this is not possible, do you have any suggestions as to how I can accomplish what I want besides myself running this report every month and having to change the table names?

I have not created any stored procedures before, but I am willing to learn. Would it be possible to create a stored procedure that receives the table name as a parameter, and base the CR report on the stored procedure? If so, where would be a good place to start learning about stored procedures?


RE: Table name parameter

Actually, you can do this if you use a command as your datasource. Open a blank report->select "add command" at the top of the table list, and then create a string parameter within the command (on the right). Then set up the command like this:

Select {?table}.`field1`, {?table}.`field2`
from {?table}

Or even more simply (if you are only using one table):

Select `field1`, `field2`
from {?table}

The punctuation depends upon your datasource.


RE: Table name parameter

Thank you! Thank you! Thank you! This is exactly what I wanted to do, and it worked. You are a great help.


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! Already a Member? Login

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