Skip to content
Advertisement

Getting a Monthly Date Range

How can you make a date range in a big query? A date range starts from 29th of the month and ends with 28th of the next month. It should be like this

Date | Starting Date | Ending Date

03-13-2020 | 02-29-2020 | 03-28-2021

06-30-2020 | 06-29-2020 | 07-28-2021

01-01-2021 | 12-29-2020 | 01-28-2021

11-11-2021 | 10-28-2021 | 11-29-2021

Actually, i make an article on it. Check this out:

https://www.theaccountingtactics.com/2021/12/BigQueryBQ-DateProblems-DateSituations-that-are-Hard-to-Analyze-and-Takes-Time-ToCrack%20.html?m=1

Advertisement

Answer

Consider below approach

if applied to sample data as in your question

output is

enter image description here

You can test whole stuff using below

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement