Problem using date difference

Hi all,

I have trouble calculating the difference in days between two date columns. No matter how I cast the two columns, it keeps returning the error posed below. On the link below the datediff function is given as an example, so I assume it is possible to use it in the query editor.

Hope somebody can help me out!

ERROR: function pg_catalog.date_diff("unknown", timestamp with time zone, timestamp with time zone) does not exist Hint: No function matches the given name and argument types. You may need to add explicit type casts.

datediff
datediff2

Hi @sergivandenberg
I think you are just looking for DATE_PART('day', "stage_change_time" - "add_time")

Thanks for the quick response!
However, it returns the same error message still.

It worked! It is DATEPART instead of DATE_PART though, thanks a lot!

@sergivandenberg It all depends on which database type and version you are querying.