if (to_char(sysdate,'miss') between '0700' and '1900' )
transact-sql语言:create proc Mypcasselect case when day(dateadd(hour,-8,getdate()))day(dateadd(hour,5,getdate()))>day(getdate()) then false else true end代码解释:如果当前时间-8小时是昨天(因为0:00是今天),或者,当前时间+5小时是明天那么查询结果是"false"否则查询结果是"true"