查询问题
string s2,d1,e2,e1,c,s1
s1=trim(sle_1.text)
s2=trim(sle_2.text)
d1=trim(ddlb_1.text)
e1 = trim(em_1.text)
e2 = trim(em_2.text)
if cbx_1.checked = false then
if s1 = '' and s2 = '' and d1 = '' then
messagebox('错误',"查询条件不能为空!")
return
else
if s1="" then s1 = '%'
if d1="" then d1 = '%'
if s2="" then s2 = '%'
dw_1.settransobject(sqlca)
c="select * from 商品信息 where 商品编号 like '"+s1+"' and 商品名称 like '"+s2+"' and 商品类型 like '"+d1+"'"
dw_1.setsqlselect(c)
dw_1.retrieve()
end if
else
if s1="" then s1 = '%'
if d1="" then d1 = '%'
if s2="" then s2 = '%'
dw_1.settransobject(sqlca)
c="select * from 商品信息 where 商品编号 like '"+s1+"' and 商品名称 like '"+s2+"' and 商品类型 like '"+d1+"' and 入库日期 > '"+e1+"' and 入库日期 < '"+e2+"'"
dw_1.setsqlselect(c)
dw_1.retrieve()
end if
integer al
al=dw_1.rowcount()
if al =0 then
messagebox('消息',"无符合条件的数据!")
else
st_9.text=string(al)
end if
dw_1.object.datawindow.readonly = "yes"
以上是我查询中的代码。保存时是没有任何问题的。但运行的时候提示:
select error:coiumn lists do not match
我看了一下,表里面的列是对得上的,我用的是ASA的数据库。大家帮忙看看是哪里的问题。先谢过了。
s1=trim(sle_1.text)
s2=trim(sle_2.text)
d1=trim(ddlb_1.text)
e1 = trim(em_1.text)
e2 = trim(em_2.text)
if cbx_1.checked = false then
if s1 = '' and s2 = '' and d1 = '' then
messagebox('错误',"查询条件不能为空!")
return
else
if s1="" then s1 = '%'
if d1="" then d1 = '%'
if s2="" then s2 = '%'
dw_1.settransobject(sqlca)
c="select * from 商品信息 where 商品编号 like '"+s1+"' and 商品名称 like '"+s2+"' and 商品类型 like '"+d1+"'"
dw_1.setsqlselect(c)
dw_1.retrieve()
end if
else
if s1="" then s1 = '%'
if d1="" then d1 = '%'
if s2="" then s2 = '%'
dw_1.settransobject(sqlca)
c="select * from 商品信息 where 商品编号 like '"+s1+"' and 商品名称 like '"+s2+"' and 商品类型 like '"+d1+"' and 入库日期 > '"+e1+"' and 入库日期 < '"+e2+"'"
dw_1.setsqlselect(c)
dw_1.retrieve()
end if
integer al
al=dw_1.rowcount()
if al =0 then
messagebox('消息',"无符合条件的数据!")
else
st_9.text=string(al)
end if
dw_1.object.datawindow.readonly = "yes"
以上是我查询中的代码。保存时是没有任何问题的。但运行的时候提示:
select error:coiumn lists do not match
我看了一下,表里面的列是对得上的,我用的是ASA的数据库。大家帮忙看看是哪里的问题。先谢过了。
...全文
相关推荐
解决Oracle分页查询中排序与效率问题
**优化后的分页查询**:考虑到性能问题,我们可以通过添加额外的条件来优化上述查询。
Mybatis查不到数据查询返回Null问题
首先,当Mybatis返回的查询结果为NULL时,可能的原因有很多。一种常见的原因是SQL语句的执行问题,例如查询条件不匹配或者SQL语句本身有语法错误。
速达软件问题查询系统(约4000条问题)
速达软件问题查询系统是一款专为使用速达软件的财务人员设计的应用,旨在提供大约4000个问题的相关解答,帮助用户解决他们在日常工作中遇到的各类问题。
解析JPA的视图查询问题
总之,通过自定义实体类和使用 `@NamedNativeQuery`,我们可以让JPA支持视图查询,从而解决在处理复杂查询或统计需求时的问题。
SqlServer 按时间段查询问题
通过理解这个问题并应用上述解决方案,我们可以确保准确地按日期范围获取所需的数据。在进行此类查询时,始终要测试并验证查询结果,以确保它们符合预期。对于那些遇到类似问题的开发者,希望这些信息能提供帮助。


