string str1 = this.txtStartDate.Text.ToString();
string str2 = this.txtEndDate.Text.ToString();
string str3 = this.txtStartTimes.Text.ToString();//eg,"16:32:23"
string str4 = this.txtEndTimes.Text.ToString(); // eg,"09:00:00"
string sql = string.format("select * from WorkEffict where (Dates>#{0} {2}# and Dates<#{1} {3}#) and (format(Dates, \"hh:mm:ss\") >=#{2}# or format(Dates, \"hh:mm:ss\") <=#{3}#)", str1, str2, str3, str4);
select * from 表 where DatesTime>=' 2009-4-23 18:33:16' and DatesTime<='2009-4-24 09:02:02'
就是这个?..得到该时间段内的数据吗?
难道不是这样吗?
SELECT * FROM DB WHERE (DATES > '2009/04/23' AND DATETIME > '18:33:16') AND (DATES < '2009/04/24' AND DATETIME < '09:02:02')