I have a cgi query form where the user selects a date range to get data
from.
I used SYSDATE as a means of inserting the date/time stamp into the table.
But the user will be entering the dates like: 7/01/2002 to 7/25/2002.
SYSDATE puts the dates in like '7/23/2002 10:38:10 AM' my question is how
can i match on this date. Should i use perl to format the date or use the
Oracle/SQL query itself to match the date. What Oracle options could i use
to do this.
Thanks
Here is the relevant code, so far:
--
# get the date strings from the form
my $fromDate = $q->param('fromDate');
my $toDate = $q->param('todate');
......
# plug into query
my $sth = $dbh->prepare("
SELECT *
FROM stats
WHERE sdate BETWEEN $fromDate AND $toDate");
or die "Cannot prepare SQL statements from $DBI::errstr\n";