Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, here's an example of how to generate the dates for the next 7 days in BigQuery:

SELECT DATE_ADD(CURRENT_DATE(), INTERVAL n DAY) as date
FROM UNNEST(GENERATE_ARRAY(0, 6)) as n

This query uses the GENERATE_ARRAY function to create an array of numbers from 0 to 6 (i.e. 7 numbers), and then adds each number as an interval of days to the current date using DATE_ADD. This generates a list of dates for the next 7 days.