select * from 记录表 where 记录时间 >= convert(datetime, substring(convert(varchar,getdate()-1,112),1,4) +'-' + substring(convert(varchar,getdate()-1,112),5,2) +'-' + substring(convert(varchar,getdate()-1,112),7,2) + ' ' + '16:00') and 记录时间 <= convert(datetime, substring(convert(varchar,getdate(),112),1,4) +'-' + substring(convert(varchar,getdate(),112),5,2) +'-' + substring(convert(varchar,getdate(),112),7,2) + ' ' + '14:00')