Tuesday, June 26, 2018

Peek on load variable

Getting full fiscal quarters via their start date:


Start:
LOAD Distinct
Date(Floor(FYStartDate),'YYYY-MM-DD') AS FYStartDate
;
SQL
Select Distinct
Min(FYStartDate) AS FYStartDate
From REF.Calendar
Where Year(FullDate) = Year(DATEADD(mm,-12,GETDATE()))
AND FYQuarter = '1'
;

LET vStartDate = peek('FYStartDate');

Drop Table Start;

No comments:

Post a Comment