cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass parameters in sql query builder

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

How to pass parameters in sql query builder

I have complex reporting requirements that can't be handle in Visual Builder. So i choose SQL query builder where i can achieve what i want but with the hard coded queries. I want to make it dynamic by passing parameters to report. For example i want to extract the sales for a time interval but user can change interval with (To and From) Dates. Need guidance how can i achieve this in sql report builder? Thanks

1 REPLY 1

Re: How to pass parameters in sql query builder

Hello @sherazsaee 

If you are trying to create admin grid and filter with date field. Please add following column with xml of ui component.


<column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date">
<settings>
<filter>dateRange</filter>
<dataType>date</dataType>
<label translate="true">Created At</label>
<sorting>desc</sorting>
</settings>
</column>

NOTE: replace 'created_at' with your field name.

It will create filter options for date with admin grid.

purchase_date.png

Problem solved? Click Accept as Solution!