JeffDrummond
asked on
Derive Quarter Begin Date
Does anyone have some simple code to derive the quarter begin date
from GetDate()?
Thanks.
from GetDate()?
Thanks.
by quarter you mean 1.jan, 1.apr, 1.jul, 1.oct ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
DECLARE @QBegin datetime
SET @QBegin = CONVERT(varchar, GetDate(), 101)
SET @QBegin = DATEADD(month, -(MONTH(@QBegin) % 3) + 1, @QBegin)
SET @QBegin = DATEADD(day, -DAY(@QBegin) + 1, @QBegin)
SET @QBegin = CONVERT(varchar, GetDate(), 101)
SET @QBegin = DATEADD(month, -(MONTH(@QBegin) % 3) + 1, @QBegin)
SET @QBegin = DATEADD(day, -DAY(@QBegin) + 1, @QBegin)