In a PostgreSQL procedure I was comparing 2 dates to find the lower and executes query according to it. But it shows syntax error.
Note that : dateform