Subquery could be added as a part of *‘Query conditions’* by defining an input parameter.
I followed the similar steps to below,
* In the *‘Query conditions’* tab, You can define the field that you want to apply condition on, as an input parameter. E.g. for your scenario, as_of_dt=@parameter_name
* This would pop up an option to select a ‘new source’, under which you can choose vdp and write your sub query by defining the ‘parameter_name’ as the output field.
* In the ‘new source’ drop-down list, you can choose one among CSV, list, JDBC, and VDP to pass the input parameter. I chose VDP as I have the relevant tables as base views in Denodo.
* Now, in the ‘Mapping’ tab below, you can define the mapping by giving the parameter_name in 'Query parameter' and the field name as defined in the source in 'Source parameter'.
* Save the job.
For your scenario, you can write a subquery to fetch all the month-end dates that go as an input to the ‘as_of_dt’ in the *Query conditions* tab. For more information, you can refer to [VDPCache Extraction Section](https://community.denodo.com/docs/html/browse/7.0/scheduler/administration/creating_and_scheduling_jobs/configuring_new_jobs/vdpcache_extraction_section#example-of-the-extraction-section-of-a-vdpcache-job) of the Scheduler Administration Guide.
Hope this helps!