现在用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#;