SQL查询时间并与当天时间对比

2024-12-17 03:22:41
推荐回答(2个)
回答1:

SELECT * FROM A
WHERE CONVERT(NVARCHAR,TIME,112) = CONVERT(NVARCHAR,GETDATE(),112)

回答2:

select * from A

where time >= CONVERT(VARCHAR(10),getdate(),120)
AND time < CONVERT(VARCHAR(10),DATEADD(DAY,1,getdate()),120)