我有这个代码。
Query q = session.createQuery("FROM SugarLevels WHERE identification = :identification AND date_submitted BETWEEN :startDate AND :endDate ORDER BY date_submitted ASC");
q.setParameter("identification", identification.toUpperCase());
q.setParameter("startDate", startDate);
q.setParameter("endDate", endDate);
但是会有一个错误 ERROR: operator does not exist: date >= character varying 我试过做
Cast(:startDate as DATE)
但仍然是一个错误。任何人都知道如何将参数转换为日期?