关于一个sql计算日期的问题select *from gkda where DATEDIFF(d,birthday,getdate())=0

2025-01-01 07:32:28
推荐回答(2个)
回答1:

select *
from gkda
where
convert(varchar(5),birthday,110)
in ((convert(varchar(5),getdate()+1,110),
(convert(varchar(5),getdate()+2,110),
(convert(varchar(5),getdate()+3,110)
)

回答2:

select * from gkda where Month(getdate())=Month(字段)
and Day(getdate())=Day(字段)