可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What's the most efficient way to calculate the last day of the prior quarter? Example: given the date 11/19/2008, I want to return 9/30/2008. Platform is SQL Server 回答1: If @Date has the date in question Select DateAdd(day, -1, dateadd(qq, DateDiff(qq, 0, @Date), 0)) EDIT: Thanks to @strEagle below, simpler still is: Select dateadd(qq, DateDiff(qq, 0, @Date), -1) 回答2: Actually simpler is: SELECT DATEADD(qq, DATEDIFF(qq, 0, GETDATE()), -1) 回答3: Get the current date SELECT CONVERT(DATE,GETDATE()) [Current Date] Get the 1st date of the quarter