【发布时间】:2014-03-04 08:05:41
【问题描述】:
这个问题可能有答案......但不适用于带有 postgresql 数据库的 openbravo。
我有 openbravo 3.0 框架。在我的窗口中,我有两个日期字段,即 fromdate 和 todate。要求是我必须编写一个 hql where 子句来根据当前日期过滤记录。日期字段是没有时区的时间戳。
表示从日期
和 todate > currentdate .
我浏览了这个link并将hql where子句写为
e.id in(select s.id from Tablename as s where s.fromdate current_date)
当我打开这个窗口时,我得到这个错误
创建查询时出现异常 select e from Tablename as e where ( e.id in(select s.Tablename_ID from Tablename as s where s.fromdate
但是,如果我将当前日期条件删除为
e.id in(select s.id from Tablename as s).. 它工作正常。
是因为 current_Date 函数吗? .我什至尝试了现在的功能..但我得到了同样的错误。
【问题讨论】:
标签: hql postgresql-8.4 openbravo