I am trying to run the following query. Not sure, what mistake I am doing:
select min(p.start_timestamp AT TIME ZONE p.timezone AT TIME ZONE 'America/Los_Angeles' ) as Date,
'America/Los_Angeles' AS Timezone, sum(GREATEST(0, p.value)) as Value
from main.production_m p
where
p.start_timestamp AT TIME ZONE p.timezone >= '2017-02-18'
and p.start_timestamp AT TIME ZONE p.timezone < '2017-02-22' + INTERVAL '1 day'
Getting the following error:
ERROR: invalid input syntax for type interval: "2017-02-20"
LINE 5: ...and p.start_timestamp AT TIME ZONE p.timezone <= '2017-02-2...
Appreciate your input. Thanks Karthey
**'2017-02-22'**what are these asterixes doing there?'2017-02-22' + INTERVAL ('1 day')or'2017-02-22' + INTERVAL '1 day'::interval