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

Pass paramater to SQL view?

Status
Not open for further replies.

mlager

Programmer
Sep 1, 2006
74
US
Is there anyway to create a SQL view, pull that view into Crystal Reports and pass a paramater to it?

I have a simple view:

select * from test where date >= ********

Can I use crystal reports 11 to pass the date to the SQL view?
 
You can use a command to do this. Go to database->database expert->your datasource->add command and enter your SQL query there, like:

Select *
From table
Where table.`date` <= {?date}

...where {?date} is a parameter created within the command screen.

-LB
 
I would use a command, but I have to link a table to this SQL statement, we all know how bad of an idea that is. Linking tables into a SQL view is much better, which is why my preference is to use a view rather than a command.
 
You could link the table within with command, and use the command as your single datasource.

Or you could, of course, just set up the parameter in CR, and use a record selection formula like:

{view.date} = {?date}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top