Trying to get difference of two Date using DateDiff function giving error

hi im trying to get difference of start_time and end_time(for charts) follwing sample$Library for charts but after changing query im getting below error

JpqlSyntaxException: Errors found for input jpql:[select DISTINCT, DATEDIFF(DAY,appointment.appointmentdate,appointment.checkInTime)   from hrems$Appointment appointment group by]
CommonErrorNode [<mismatched token: [@12,54:54='(',<27>,1:54], resync=(DAY,appointment.appointmentdate,appointment.checkInTime)   from hrems$Appointment appointment>]


JPQL doesn’t support DATEDIFF function.
You can try to use FUNCTION with the native SQL function.

1 Like