"I am using query for getting data from current date to yesterday date in Bigquery but i am not able to get the yesterday date in BQ"
SELECT COUNT (*)
FROM `urbn-edw-prod.UrbnProcessingErrors.RetailFeedDimensionError`
WHERE errorReason = "Invalid Merchandise SKUs"
AND DATE(ingestionTime) between CURRENT_DATE and DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY)
this line of code is not giving yesterday date i think
DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY)
I want to get the data from today till yesterday in BQ but i think i am using wrong query I expect output to be 500 for now but it is giving 0
You can use:
Or more simply:
When you use
BETWEEN
the order of the last two operands matters. The smaller value is first, the larger value second.