Jump to content

Is it possible to have same parameter in from and the where clause of sql query?


mandm

Recommended Posts

 Hi All,

I am trying to create a report which uses the table name as a lookup in another table to get the resultset needed for the report

my sql query is something like this

 

select count(*) as denominatorCnt , inspectionCount, (count(*)/inspectionCount) as thermpct

from $P!{MyTable} t1,  report3 t2

where quarter(created_date) = $P{R3QTR}

  and year(created_date) = $P{R3YR}

  and trim(concat('_data', t2.id, '_', t2.table_name)) = $P{MyTable}

 

so my where clause the from clause has same parameter, but if you noticed i use a ! in the from clause as per the guidelines...

The issue with this is the where clause MyTable always tables the default parameter expression and never changes even when the from is changing

so please let me know if i am doing something wrong or is there a different way to do this?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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...