0

As it gives unexpected token: DAY. Anybody suggest what should be the alternative of DAY here

select p from Patient p where p.id in(select a.patient.id from p.assessments a where (a.appointmentDate <=(CURRENT_DATE + interval 6 DAY) and a.appointmentDate >=(CURRENT_DATE)) and a.chatBotStatus='LINK_CREATED')

As I am new in data JPA so any answer will be appreciable

mkc
  • 3
  • 3

1 Answers1

0

Try using native query something like this:

@Query(value = "select * from activation_codes a where a.type = :type and a.id_account = :id_account and a.creation_time <= NOW() - :hoursAgo * INTERVAL '1 hour'", nativeQuery = true)

please refer this - https://stackoverflow.com/a/51954042/4076451

Jeethesh Kotian
  • 314
  • 1
  • 3
  • 12