Jump to content

Parameter query


mcrist

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

oh... this is a good dilemma... and i like it.

I suppose that you assume that the two (or more) tables have the same structure... ok?
I think also tha the text you typed isn't in a sql standard format... so it isn't correct.

you can obtain a similar result (I have tried it and it works fine ! :) ) with a little trick:
define two string parameters:

"table_name" with default value: "TEST_TABLE"

and "where_sql" with default value: " 1=1"

then you can declare the sql query as:

select * from $P!{table_name} where $P!{where_sql}

(NOTE the $P! syntax and the use of default values... without them you can't have any filed available to create the report layout)

now, try to design you report and...
then,  you can run it passing the table name you prefer, with the where-clauses you want...

obviously , the field you use in the report layout must be present in all tables wich name you want to pass as parameter

_________________________________________

if it works... give me KARMA points please!    : ) 
_________________________________________

listening:   The Rentals - Friends of P.

"If you're down with P.
Well, then you're down with me.
If you're friends with P.
Well, then you're friends with me." (t.r.)

in this case P stand for IReport $P .... :)

 

dimenticavo...  forza               italia! ... quella vera.



Post Edited by slow at 06/18/2010 12:03
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...