ROLLING date range in a Google Ads API Query
let startDate = '2020-01-01'; let endDate = new Date().toISOString().slice(0, 10).toString(); // "WHERE segments.date BETWEEN '2020-01-01' AND 'endDate' "
Returns this error:
Exception: Call to GoogleAdsService.Search failed: Condition 'segments.date BETWEEN '2020-01-01' and 'endDate'' is invalid: BETWEEN operator must have exactly two values that are both numbers or both date strings in 'YYYY-MM-DD' format.
How can I set endDate to YESTERDAY?