Forum Stats

  • 3,874,160 Users
  • 2,266,675 Discussions
  • 7,911,745 Comments

Discussions

page item (date picker)

prog
prog Member Posts: 80
edited May 7, 2013 9:35AM in APEX Discussions
I have added a date picker to my report . and in the report source I've added a where clause to filter the report as per the selected date(which is one of the columns in the table) but there is nothing shown.
where DATE =:P23_DATE

when I remove the where clause all the records appear and when I return it ..nothing there.
can someone help me?

Edited by: Beena-IT on May 4, 2013 7:19 AM
Tagged:

Best Answer

  • Howard (... in Training)
    Howard (... in Training) Member Posts: 905
    edited May 4, 2013 10:06PM Answer ✓
    You have data, that's good. You've isolated the problem to what seems to be the WHERE clause, good. The WHERE clause is simple, good. So, it would seem DATE NOT = :P23_DATE for your query.

    Remember -- or note, if you didn't know this -- page items are (always?, mostly) character strings. As Jeff intimates, if DATE is a date, you will get implicit date conversion in your WHERE clause. (BTW, isn't DATE a Reserved Word?) May I suggest trying "DATE = TO_DATE(:P23_DATE,'your date format here')" to make it an explicit conversion?

    Also, I recommend running any query you are having a problem with in the APEX SQL Commands window. Then you can immediately see what APEX is returning for your query. It helps my debugging a lot.

    Regards,
    Howard

Answers

  • jwellsnh
    jwellsnh Member Posts: 1,816 Silver Trophy
    Please share the code you are trying to run.

    Can I assume that the attribute DATE is a true date?

    Jeff
  • Howard (... in Training)
    Howard (... in Training) Member Posts: 905
    edited May 4, 2013 10:06PM Answer ✓
    You have data, that's good. You've isolated the problem to what seems to be the WHERE clause, good. The WHERE clause is simple, good. So, it would seem DATE NOT = :P23_DATE for your query.

    Remember -- or note, if you didn't know this -- page items are (always?, mostly) character strings. As Jeff intimates, if DATE is a date, you will get implicit date conversion in your WHERE clause. (BTW, isn't DATE a Reserved Word?) May I suggest trying "DATE = TO_DATE(:P23_DATE,'your date format here')" to make it an explicit conversion?

    Also, I recommend running any query you are having a problem with in the APEX SQL Commands window. Then you can immediately see what APEX is returning for your query. It helps my debugging a lot.

    Regards,
    Howard
  • prog
    prog Member Posts: 80
    Yes that was correct
This discussion has been closed.