我有这个查询,我用它来获取两个日期之间的记录信息。
$start=$_REQUEST['from'];
$end=$_REQUEST['to'];
$startd = str_replace('/', '-', $start);
echo $start1=date('Ymd', strtotime($startd));
$endd = str_replace('/', '-', $end);
echo $end1=date('Ymd', strtotime($endd));
echo $data ="SELECT * from forma
WHERE DATE(data) BETWEEN '".$start1."' AND '".$end1."' ";
$res = odbc_exec($connection, $data) or die(odbc_error());
我收到此错误:
]'DATE' is not a recognized built-in function name., SQL
但是我如何在 SQL 中解决这个问题?
data
是一种varchar
类型。。
谢谢