How Can I apply filter in custom report

Can anyone guide me how to apply filter in query report. I’m able to generate report using sql query but I want to give some filter also in my report. Please guide me.

Thank You.

Add the filter in the Filter Table as follows:
Fieldname: variable_name
Label : the label of the variable name displayed in the report
Fieldtype: type of the filter, if it is date then choose date or if it is simple string then choose data.

Then back in sql query where clause you can put filter like:

select * from table where name=%(variable_name)s ;

variable_name is the name that you have set in the Filter Table. Note variable name should not consist of blanks if more than one word.