BigQuery - Set date to April 1st based on current date
When you need to set
start_date to current financial year’s starting date.
DECLARE start_date date; SET start_date = CURRENT_DATE(); SET start_date = DATE(IF(EXTRACT(MONTH FROM start_date) < 4, EXTRACT(YEAR FROM start_date) - 1, EXTRACT(YEAR FROM start_date)), 4 , 1); SELECT start_date as month
19. Apr 2023