kizziebutler
Programmer
Hello I would like to create a search button (push button) that will allow the user to input two dates and search fields between two dates. I have be able to do this successfully when search for numeric fields but not sure how to code the pl/sql (when-button push) for the dates, here a sample of my code for searching for numeric data such as deptno. Your help would be much appreciated.
DECLARE
v_where VARCHAR2(2000) := NULL;
v_ename VARCHAR2(30) := :control.ename;
v_deptno NUMBER := :control.deptno;
BEGIN
--
IF v_deptno IS NOT NULL
THEN
v_where := 'DEPTNO = ' || v_deptno;
END IF;
set_block_property('EMP', DEFAULT_WHERE, v_where);
-- Query
go_block('EMP');
execute_query;
EXCEPTION
WHEN OTHERS
THEN
message(SQLERRM);
END;
DECLARE
v_where VARCHAR2(2000) := NULL;
v_ename VARCHAR2(30) := :control.ename;
v_deptno NUMBER := :control.deptno;
BEGIN
--
IF v_deptno IS NOT NULL
THEN
v_where := 'DEPTNO = ' || v_deptno;
END IF;
set_block_property('EMP', DEFAULT_WHERE, v_where);
-- Query
go_block('EMP');
execute_query;
EXCEPTION
WHEN OTHERS
THEN
message(SQLERRM);
END;