PHP ADO ACCESS数据库,SQL如何比较时间大小

WBOY
Release: 2016-06-13 11:48:41
Original
990 people have browsed it

PHP ADO ACCESS数据库,SQL怎么比较时间大小?
现在用PHP + ADO + ACCESS数据库,比较时间遇到问题

ACCESS数据库的Time字段存储的为 COleDateTime格式的时间数据。
下面二行代码为MFC 编程时写入数据库的“Time”字段的代码
COleDateTime ct=COleDateTime::GetCurrentTime();
m_pRecordset_record->PutCollect("Time",_variant_t(ct));
-------------------------------------------------------
下面是我想达到的日期筛选SQL,但实际上sqlstr这样写是有问题的,php执行错误的,想请教一下怎样写才是正确的。
$sqlstr="select * from record where NameStr='$sensor' and Time>'2014/01/15'";
$rsRecord1->Open($sqlstr,$conn1,1,1);
------解决方案--------------------
$sqlstr="select * from record where NameStr='$sensor' and Time>#2014-01-15#";

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!