search by oracle dates using asp
If the following is the table structure in Oracle 8i...
table name: TEST
ID DATE
-- ----
11 8/15/2004
12 9/15/2004
13 10/15/2004
14 11/15/2004
I know it can be done through Oracle 8i SQL PLUS by..
select * from TEST where DATE > to_date('9/1/2004', 'mm/dd/yyyy') and DATE < to_date('10/30/2004', 'mm/dd/yyyy');
The result should display...
ID DATE
-- ----
12 9/15/2004
13 10/15/2004
The question is... how can I store '9/1/2004' and '10/30/2004' into two String variables and execute the same query with the same result.
For instance,
beginningDATE = '9/1/2004'
endingDate = '10/30/2004'
select * from TEST where DATE > to_date(beginningDATE, 'mm/dd/yyyy') and DATE < to_date(endingDate, 'mm/dd/yyyy');
When I execute the above, I get the following error message:
ORA-00907: missing right parenthesis
Thanks in advance.
--Brian
|