I've also tried opening cursor: quincy=> open ref for select to_char(qdatetime, 'YYYY-MM-DD') as QDATETIME,ID,NAME,CATEGORY,APPSVERSION,OSVERSION,DETAILS,DEVINFO from quincyview where qdatetime <= now() order by QDATETIME desc ; ERROR: syntax error at or near "open" LINE 1: open ref for select to_char(qdatetime, 'YYYY-MM-DD') as QDAT... ^ -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general