Forum Stats

  • 3,838,564 Users
  • 2,262,383 Discussions
  • 7,900,687 Comments

Discussions

Why is this not working in APEX

Brian666H
Brian666H Member Posts: 33 Red Ribbon

SQL : SELECT Count(B.CREATION_DT) CT

,to_char(B.CREATION_DT, 'W') theweek

FROM [email protected] B

WHERE B.MONTHCD = NVL(:P7_MONTHCD, NVL(:P7_MONTHCD, B.MONTHCD))

and B.YEAR_FROM = NVL(:P2_YEAR, NVL(:P2_YEARFROM, B.YEAR_FROM))

AND B.VENDOR_ID = NVL(:P2_VENDOR, B.VENDOR_ID)

AND B.VCHR_SRC = NVL(:P2_VOUCHERSOURCE, B.VCHR_SRC)

AND B.MATCH_RULE_ID = NVL(:P2_MATCH_RULE, B.MATCH_RULE_ID)

AND B.BUSINESS_UNIT = NVL(:P2_BUSINESSUNIT, B.BUSINESS_UNIT)

group by to_char(B.CREATION_DT, 'W')

Results: are what I want in SQL Developer.

However, regardless of the control I select I only get 1 row.

Suggestions?

Tagged:

Best Answer

  • Hamza Al-abbasi
    Hamza Al-abbasi Member Posts: 596 Gold Trophy
    edited Jul 3, 2022 3:48PM Answer ✓

    Hi,

    Make sure that the bind items (P7_MONTHCD etc..) you have used in the region SQL Query are have values in the session. From your region attributes, set "Page Items to Submit" to these items.

Answers