access日期与sql server日期区别

如选取一段时间内的数据,time1和time2是时间起始字符串,则

sql server命令:

string strSQL=" 日期 >='"+time1+"' AND 日期 <= '"+time2+"'";

access命令:
string strSQL=" 日期 >=#"+time1+"# AND 日期 <= #"+time2+"#";

 

主要区别在于sql server的日期字段值用单引号,而access用##。

如sql server是:

select * from table where  日期>'2010/7/7';

access是:

select * from table where  日期>#2010/7/7#;

posted @ 2016-07-08 09:27  mat_wu  阅读(469)  评论(0编辑  收藏  举报