Ruben Gouveia escribió: > No matter how many times i try, i can't seem to get the write amount of ' > marks around the date parameters in my v_where declaration. What am i doing > wrong here?
Apparently you're not aware that you can nest the $$ quote marks. You could just use $a$ to assign to the varchar, and use ' inside that string to get the literal '. Of course, you could use also $b$ instead of a plain single quote. That is, v_where varchar(256) := $a$ where m.jb_date < $a$||p_date + integer '1'|| $a$ and m.jb_date >='$a$ ||p_date|| $a$'$a$; or (harder to read) v_where varchar(256) := $a$ where m.jb_date < $a$||p_date + integer '1'|| $a$ and m.jb_date >=$b$ $a$ ||p_date|| $a$ $b$ $a$; -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql