计算当前季度的最后一天

2022-01-09 00:00:00 sql sql-server coldfusion

计算当前季度最后一天最有效的方法是什么?

What's the most efficient way to calculate the last day of the CURRENT quarter?

示例:给定日期 3/5/09,我想返回 3/31/09.

Example: given the date 3/5/09, I want to return 3/31/09.

平台是 ColdFusion 和 SQL Server

Platform is ColdFusion and SQL Server

推荐答案

SELECT     DATEADD(qq, DATEDIFF(qq, - 1, '3/5/09'), - 1) 

相关文章