例如:
假設您需要查詢表中日期在starttime和endtime之間的記錄。字段名為addtime,表名info如下。
start time = " 2009-2-3 10:00:00 "
end time = " 2009-4-3 10:00:00 "
strSql = " select * from info where add time between # "+start time+" # and # "+end time+" # ";
註意,壹定不能忘記# here,它與SQLserver不同。