Forum OpenACS Q&A: Response to month info query & date arithmetic

Collapse
Posted by Gilbert Wong on

Two things I can think of offhand.

  1. If you are using { } to enclose your sql query instead of " ", it will not substitute $date into your sql query. It will literally use $date.
  2. You need to make sure $date is in timestamp/date format.

to_char(timestamp($date, 'YYYY-MM-DD') + '7 days'::interval,'YYYY-MM-DD') as next_weeks_date

I think I got the syntax correct.