Error using function DATEDIFF

Moderator: NorbertKrupa

Post Reply
sumit.gadgilwar
Newbie
Newbie
Posts: 3
Joined: Thu Jan 03, 2013 1:25 pm

Error using function DATEDIFF

Post by sumit.gadgilwar » Mon Jan 07, 2013 10:26 am

Error using function DATEDIFF
SELECT DATEDIFF('ss', TIME '04:44:42.315786', INTERVAL '2 05:55:52.963558');

Error: [Vertica][VJDBC](3457) ERROR: Function catalog.datediff(unknown, time, interval(in seconds)) does not exist, or permission is denied for catalog.datediff(unknown, time, interval(in seconds))
SQLState: HY000
ErrorCode: 3457

-------------------
Sumit Gadgilwar
-------------------

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Error using function DATEDIFF

Post by JimKnicely » Mon Jan 07, 2013 2:11 pm

Hi,

I believe that the 2nd and 3rd parameters of the DATEDIFF function must be of the same type. That is, they either have to be both TIME or BOTH INTERVAL.

In you case, maybe this is best?

Code: Select all

dbadmin=> SELECT DATEDIFF('ss', INTERVAL '0 04:44:42.315786', INTERVAL '2 05:55:52.963558');
 datediff
----------
   177070
(1 row)
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: Error using function DATEDIFF

Post by id10t » Mon Jan 07, 2013 2:32 pm

Hi Sumit Gadgilwar!

Why you provides to us queries that you did copy/paste from Vertica Reference Manual version 3.5?
If it's not works, so may be you will read manual for your version?

Post Reply

Return to “New to Vertica”