这句话是不能执行,还是达不到效果。
goodsType 的内容是什么。建议看看这个:
http://expert.csdn.net/Expert/topic/1384/1384270.xml?temp=.784115
goodsType 的内容是什么。建议看看这个:
http://expert.csdn.net/Expert/topic/1384/1384270.xml?temp=.784115
解决方案 »
- 在excel中插入图表时,range的设置问题。
- access数据库中第一列设为主键,为何在datagrid中排列顺序出现错误?
- 关于API中右键菜单执行事件的问题
- 用winsock查找主机是否时,2000系统可以很快的运行完,但是在xp下要运行几分钟才能运行完.
- 关于拖拽的问题?
- VB操作Excel文件时出现错误componet busy:this action cannot be completed because the other application is busy
- VB中怎么删除txt文本文件里的内容
- 有函数可以把数据库中的表读出来吗?!
- (在VB下怎么获得系统分辩率)
- 怎样通过修改注册表把把我的程序加到IE的工具拦中去?(象金山词霸)
- vb习题望求得解答
- 怎么样将线置于picture的上面??谢谢回复。。
(CASE XX WHEN 条件1 TEHN 答案1
WHEN 条件2 TEHN 答案2
WHEN 条件3 TEHN 答案3
ELSE 无答案 END) AS XX
sqlstr="select id as 库存单编号,goodsname as 存货名称,type as 类型,num as 数量,date as 最后入库日期,introduce as 摘要,(case belong when '1' then '固定资产' when '2' then '低值易耗品' end) as 种类 from store where type='" & goodsType & "'"
或
其中Chr(&H22)是双引号 "
如果使用
sqlstr="select id as 库存单编号,goodsname as 存货名称,type as 类型,num as 数量,date as 最后入库日期,introduce as 摘要," _
& "case belong when '1' then '固定资产' when '2' then '低值易耗品' end from store where type='" & goodsType & "'"
即去掉belong的别名
sqlstr = "select id as 库存单编号,goodsname as 存货名称,type as 类型,num as 数量,date as 最后入库日期,introduce as 摘要," _
& "(case belong when '1' then '固定资产' when '2' then '低值易耗品' end) " & Chr(&H22) & "种类" & Chr(&H22) & " from store where type='" & goodsType & "'"
其中Chr(&H22)是双引号 "