Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2069

Passing value of one table as parameter to another table in joins

$
0
0

Hi all,

 

  I have a scenario where i would need to pass the select field of one table to another table in the same join condition.

 

The below query does not run as expected:

 

as select from    P_UtilizationAPFdates(P_EndDate :$parameters.P_EndDate)  as DateCalc
    left outer join I_Catsprojinfodet(P_Language:$parameters.P_Language,P_StartDate: 'DateCalc.StartDate'  , P_EndDate: 'DateCalc.EndDate ') as                                                             CatsProjInfo on DateCalc.EndDate = $parameters.P_EndDate

 

In the parameters: P_StartDate: 'DateCalc.StartDate'  , P_EndDate: 'DateCalc.EndDate ' I would expect the value of the Datecalc.Startdate to be filled.

But this does not happen. And takes the sydate always.


I want to pass the dates that i fetch from the table P_UtilizationAPFdates as input to the next table I_Catsprojinfodet


The use case behind this is:

The DATS_ADD_MONTHS function is not supported to have it in the parameter list. Hence i had introduced a new view P_UtilizationAPFdates inorder to use the function DATS_ADD_MONTH so that i can get the required start date(two years back date).

So i need to pass this result as parameter to the main table I_Catsprojinfodet.


How can i achieve this.

Please  help.

 

thanks,

   Sathya


Viewing all articles
Browse latest Browse all 2069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>