This is designed so that, if any of the date fields are NULL, then the minimum or maximum date will be used for the query.
where table_date >= to_date(nvl(:P1_BEGIN_DATE, '01-jan-1900'), 'dd-mon-yyyy') and table_date <= to_date(nvl(:P1_END_DATE, '31-dec-2300'), 'dd-mon-yyyy')
My P1_GO button was automatically changed to "Controlled by Dynamic Action". And "Execute Validations" for this button is set to "Yes".
Event: Click Type: Button Button Name: P1_GO Condition: - No Condition - Action: Refresh Fire When Event Result Is: True Fire On Page Load: Checked Selection Type: Region Region Name: People Count Event Scope: Static Condition Type: PL/SQL Function Body Returning A Boolean My PLSQL Code in Expression 1: IF ( (:P1_BEGIN_DATE IS NOT NULL) AND (:P1_END_DATE IS NOT NULL) ) THEN RETURN TRUE; ELSE RETURN FALSE; END IF;
Check this out for your situation, there seems to be a zillion ways to check for null
($v('P1_BEGIN_DATE') !== null) && ($v('P1_END_DATE') !== null)