資料 A B
2007-10-18 上午 11:20:22 thems
2007-10-16 上午 11:20:23 thems
2007-10-17 上午 11:20:24 thems
2007-10-18 上午 11:20:26 thems我想要得到 2007-10-18全天的記錄怎麼寫?
大或小於2007-10-18全天的呢?
我使用Convert只能將時間轉為 2007-10-18 00:00:00 的格式
不能對比查找
2007-10-18 上午 11:20:22 thems
2007-10-16 上午 11:20:23 thems
2007-10-17 上午 11:20:24 thems
2007-10-18 上午 11:20:26 thems我想要得到 2007-10-18全天的記錄怎麼寫?
大或小於2007-10-18全天的呢?
我使用Convert只能將時間轉為 2007-10-18 00:00:00 的格式
不能對比查找
select * from t where convert(varchar(10),date1,120)='2007-10-18'
等于:
select * from 表名 where convert(varchar(10),A,120) = '2007-10-18'
大于:
select * from 表名 where convert(varchar(10),A,120) > '2007-10-18'
小于:
select * from 表名 where convert(varchar(10),A,120) < '2007-10-18'