select * from 表 where 时间字段>=convert(char(10),getdate()-1,120)+' 12:00' and 时间字段<convert(char(10),getdate(),120)+' 12:00'
select * from tablename where time >=(convert(datetime,convert(char(12), GETDATE(), 2) + '12:30')-1) and time < = and time <= (convert(datetime,convert(char(12), GETDATE(), 2) + '12:30'))z这样一来就可以了哦
select * from 表
where 时间字段>=convert(char(10),getdate()-1,120)+' 12:00'
and 时间字段<convert(char(10),getdate(),120)+' 12:00'
where time >=(convert(datetime,convert(char(12), GETDATE(), 2) + '12:30')-1) and time < = and time <= (convert(datetime,convert(char(12), GETDATE(), 2) + '12:30'))z这样一来就可以了哦