This discussion is archived
1 Reply Latest reply: Oct 4, 2012 6:57 AM by Bas de Klerk RSS

Serch filter in Report

Vedant Explorer
Currently Being Moderated
Hi,
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?
  • 1. Re: Serch filter in Report
    Bas de Klerk Pro
    Currently Being Moderated
    Hi Vedant.


    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)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points