SQL获取当天注册数据的2种写法
--获取当天注册数据的2种写法,当然更推荐第二种
--第一种
select RegisterDate from [QPAccountsDB].[dbo].[AccountsInfo] where CONVERT(varchar(10),RegisterDate,120)=CONVERT(varchar(10),GETDATE(),120)
--第二种
select RegisterDate,datediff(dd,RegisterDate,getdate()) from [QPAccountsDB].[dbo].[AccountsInfo] where datediff(dd,RegisterDate,getdate())=0