Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Mssql 中有一个表,在该表中我有两列保留不同的日期。(两种数据类型都是 smalldatetime)我的目标是,如果差异等于 60 天或大于 60 天,那么我想将此值绑定到网格视图中。如何在单个 sql 查询中获取这些值?谢谢你的帮助。
信息不多,所以最好的猜测是这样的:
SELECT DATEDIFF(day, date1, date2) Difference, date1, date2 FROM aSecretTable WHERE DATEDIFF(day, date1, date2) >= 60