Date comparison...database query
Posted on 2002-05-16
I have a form which passes 3 values (day, month, year).
I concat. the 3 values together..
$sdate = sdate_dd + "-" + sdate_mm + "-" + sdate_yy;
how can I do a SQL query to retrieve records less than this date? I am using ORacle database.
my current query is as follows:
$query = "select * from tableA where sdate < $sdate";
but it complains with the following message
OCIStmtExecute: ORA-01861: literal does not match format string