I am applying search filters on report. I have created two date items :P57_GL_F_DATE and :P57_GL_T_DATE . I have written code in report to search record between two dates .but that is not working. How can i do this?
Working with apex4.1
select gl_date from AP_SUPPLIER_INVOICES_V where (GL_DATE BETWEEN :P57_GL_F_DATE AND :P57_GL_T_DATE or :P57_GL_F_DATE is null and :P57_GL_T_DATE is null)
When i click on search button to search for report, It displays massage no data found in report.
What changes i do in this report so that it works?
Typecasting the bind variable ( which is actually a string ) to a date format probably fixes your issue.
So assuming the date format on the screen is DD_MON-YYYY the statement would look like :
select gl_date from AP_SUPPLIER_INVOICES_V where (GL_DATE BETWEEN TO_DATE(:P57_GL_F_DATE,'DD_MON-YYYY') AND TO_DATE(:P57_GL_T_DATE) or :P57_GL_F_DATE is null and :P57_GL_T_DATE is null)