Last active
November 7, 2019 16:47
-
-
Save mburbea/ed4f6a7550edbf641463138fc1b0cc77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select dateadd(d,offset,eo_2_months) | |
from ( | |
select last_day(dateadd(month,-2,CURRENT_TIMESTAMP),month) | |
) z(eo_2_months) | |
cross join (values(1),(2),(3),(4),(5),(6),(7))o(offset) | |
where dayofweek(dateadd(d,offset,eo_2_months))=3 | |
order by 1 | |
offset 0 rows fetch next 1 row only |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment