天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 2623|回复: 7

[已解决] DQL查询的,语法问题,请指教,该怎么写。

[复制链接]
金中软件 发表于 2012-6-5 10:54:06 | 显示全部楼层 |阅读模式
本帖最后由 shary 于 2012-6-12 10:06 编辑

1.jpg

var stime = getItemValueAsDate("cx_nyq");
if(stime!=""&&stime!=null){
  w +=" and $ReportFormsTime < "+ stime +"";
}

提示:缺失表达式
bess 发表于 2012-6-5 11:11:59 | 显示全部楼层
正在q上沟通。。
purple 发表于 2012-6-5 18:23:42 | 显示全部楼层
将var stime = getItemValueAsDate("cx_nyq");
if(stime!=""&&stime!=null){
  w +=" and $ReportFormsTime < "+ stime +"";
}
修改为
var stime = getItemValueAsDate("cx_nyq");
if (stime != "" && stime != null) {
w += " and to_char(ReportFormsTime,'yyyy-MM-dd') < '" + stime + "'";
}
不会再报错。但是时间比较不生效。已建议客户使用sql的模式处理。
 楼主| 金中软件 发表于 2012-6-6 09:39:14 | 显示全部楼层
回复 3# purple


    请提供sql的模式处理的例子。
irene 发表于 2012-6-6 10:11:30 | 显示全部楼层
您好,您可以参考这个链接:http://www.2cto.com/database/201106/94333.html
您先看看,有问题我们再沟通
 楼主| 金中软件 发表于 2012-6-11 15:05:37 | 显示全部楼层
已经采用其他办法解决
 楼主| 金中软件 发表于 2012-6-12 09:56:24 | 显示全部楼层
回复 6# 金中软件


    我采用的是ORACLE数据库,DQL时间查询是有很多问题,因此只能采用varchar2字段类型,也就是不能使用时间控件。
purple 发表于 2012-6-12 13:42:07 | 显示全部楼层
非常感谢楼主的分享。

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-12 10:36

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表