sql server中的字段是datetime类型,而用户提出的选择条件是以天为单位的,未精确到时分秒等
经过试验,我个人觉是最优方式是
select * from tt where date between ‘2007-02-13 00:00:00.000’ and ‘2007-02-13 23:59:59.999’
比起 … where convert(datetime, convert(varchar,date ,112), 112) = ‘2007-02-13’ 要快多了