1.sql server 2000時間需要用單引號' '括起來
strsql.format(_t("select * from info where 入庫時間 between "));
strsql+=begindate.format( _t("'%y-%m-%d " ));//sql server中時間需要用單引號''括起來,而access需要##括起來
strsql+=begintime.format( _t("%h:%m:%s'" ));
strsql+=_t(" and ");
strsql+=enddate.format( _t("'%y-%m-%d " ));
strsql+=endtime.format( _t("%h:%m:%s'" ));
strsql+=_t(" order by 入庫時間 asc ");
2.access中時間需用雙井號# #括起來
str.format(_t("select * from 節點資訊 where 時間 between "));
str+=begindate.format( _t("#%y-%m-%d " ));
str+=begintime.format( _t("%h:%m:%s#" ));
str+=_t(" and ");
str+=enddate.format( _t("#%y-%m-%d " ));
str+=endtime.format( _t("%h:%m:%s#" ));
str+=_t(" order by 時間 asc ");
SQL時間段查詢
access的話 select from table where date1 2008 1 20 and date2 2007 8 30 mysql的話 select from table where date1 2008 1 20 and date2 2007 3 30 也可以 select fr...
SQL時間段查詢
sql時間段查詢 access的話 select from table where date1 2008 1 20 and date2 2007 8 30 mysql的話 select from table where date1 2008 1 20 and date2 2007 3 30 也可以 ...
SQL時間段查詢
sql時間段查詢 access的話 select from table where date1 2008 1 20 and date2 2007 8 30 mysql的話 select from table where date1 2008 1 20 and date2 2007 3 30 也可以 ...