我是SQL Server的新手。请帮助我在查询中写下下面的逻辑。
If getnow() > today 4 PM
Then
SELECT *
FROM table
WHERE MailDate is Tomorrow
Else
SELECT *
FROM table
WHERE MailDate is Today发布于 2012-04-20 07:02:23
select *
from table
where DATEDIFF(day, GETDATE(), maildate) = case when
DATEPART(hour, GETDATE()) >= 16 then 1 else 0
endhttps://stackoverflow.com/questions/10237984
复制相似问题