I am trying to get this postgres query:
COALESCE(
NULLIF(drug_exposure_start_date + (INTERVAL '1 day' * days_supply), drug_exposure_start_date)
Into big query. Here is what I think should work:
SELECT
COALESCE (
NULLIF(date_add(drug_exposure_start_date, INTERVAL (1 day * days_supply)), drug_exposure_start_date))
from `x`
This is the error message that I get:
Error: Syntax error: Parenthesized expression cannot be parsed as an expression, struct constructor, or subquery at [3:53].
Any help would be greatly appreciated, thank you.