Where/how are you executing this query? It looks like Vision, but are you directly executing it as a binding, or via a script? Can you take a screenshot?
{Root Container.Popup Calendar.formattedDate} must be a string parameter. Assuming that’s true, what you need to do is add a string parameter to your named query. (Push the plus button toward the top right of your screen). Use that parameter in place of “{Root Container.Popup Calendar.formattedDate}”. The syntax will be TO_TIMESTAMP(:parameterName, 'yyy-MM-dd...') the colon is important.
In your vision window you’ll pass {Root Container.Popup Calendar.formattedDate} into the parameter. Once you’ve added the parameter in your named query and saved the project there will be a pretty obvious spot to do this in the binding dialogue box.
I don’t use postgresql myself, so I can’t say for sure, but I would bet that you can’t use MM for both the month field and the minutes field. One or the other should probably be lower case.
Y’all are asking for future trouble. If you can use a named query, then there is NO reason to convert your timestamp to a string and then back to a timestamp in PostgreSQL. Simply use a value parameter of type datetime (which is perfectly compatible with PostgreSQL timestamptz and friends). The precise UTC value of your timestamp will be passed in binary format through JDBC. Faster, too.
If you are formatting a date/time as a string to get your DB to interpret it, you are almost certainly screwing up.
can anybody help me with an other thing please?
How do I subtract 12 hours for example, from CURRENT_TIMESTAMP or how do I write the query above to show only the rows inserted in the last 24 hours?
Q. Where are the DATEADD and DATEDIFF functions in PostgreSQL? A. There are none. PostgreSQL does not need them. Use the + and - operators instead. Read on.
So subtracting 12 hours should be something like this: