社区
DataWindow
帖子详情
datawindow compute
zhyx21century
2002-12-10 06:16:56
在dw printer设置compute
sum(convert(integer,pbuseview.Amount)) as amount
pbuseview.Amount是vchar类型
warnning
Line: 1
SQLSTATE = 37000
[Lotus]Name,constat,or expression expected Continue?
...全文
48
10
打赏
收藏
datawindow compute
在dw printer设置compute sum(convert(integer,pbuseview.Amount)) as amount pbuseview.Amount是vchar类型 warnning Line: 1 SQLSTATE = 37000 [Lotus]Name,constat,or expression expected Continue?
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
10 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
zhyx22century
2002-12-12
打赏
举报
回复
up
hoho
zhyx21century
2002-12-11
打赏
举报
回复
其实你们所说的方法,我早都用过了,都出错呀!呜呜呜呜呜呜呜
zhyx21century
2002-12-11
打赏
举报
回复
其实你们所说的方法,我都用过了,都出错呀!呜呜呜呜呜呜呜
zhyx21century
2002-12-11
打赏
举报
回复
sum(int(pbuseview.Amount)) as amount
warnning
the right parenthesis missing!
where is the missing??? i can't find it
wonder01
2002-12-11
打赏
举报
回复
你想使用convert函数,但这个函数应该是数据库的函数,除非你是这个函数是直接嵌入在sql语句中的(因为这样才是在数据库端执行),如果只是数据窗口的一个计算列,那它就是在本地执行的,和数据源没有关系了。所以如果你要转换他的类型,必须使用pb提供的,这里你可以这样写:
sum(integer(这里写数据窗口中指定的列名,并非"表.字段"名,当然列名一般情况会是"表_字段")) as amount
zhyx21century
2002-12-11
打赏
举报
回复
to ldy:
用你说的方法也是错的,error text 一样的
dotnba
2002-12-10
打赏
举报
回复
sum(integer(pbuseview.Amount)) as amount
dotnba
2002-12-10
打赏
举报
回复
convert是SQL的内置函数,不是数据窗口函数
balloonman2002
2002-12-10
打赏
举报
回复
你这是计算列吗?都是SQL的语法吧
flyhot
2002-12-10
打赏
举报
回复
what's you want?
pb技巧
data
window
pb,技巧,数据窗口,
data
window
,列名
PB数据窗口source介绍及举例
数据窗口源码介绍 (举例见d_dbit_example.srd,测试数据库为PB自带的EAS Demo DB V120) 1.第一行:release 12; 数据窗口所属PB的版本号,如果想把高版本的
data
window
导入低版本的PB中要修改此数字; 2.
data
window
()行 通常用修改processing属性,可以把你的数据窗口由grid变成freeform或其它类型 例:freeform:0 grid:1 3.header()行 可以整行复制粘贴,并命名为header[1],header[2],这样可以让数据窗口有多个header 4.table()行 这里全是定义的数据属性,是setitem,update,object.
data
等方法访问的根源 如果存在table()里的column,数据窗口里可以不存在任何对象,仍然可以访问数据窗口的数据 如果想创建一个空的数据窗口,可以只定义: release 12; table() 5.table(column行) 是第几个column,它的ID就是多少,其中也定义了是否可以update时和更新到数据表的字段名 6.table(retrieve行) 检索数据时使用的SQL语句,可以通过setsqlselect或modify("table.sqlselect")方法去动态修改 修改后要重新定义数据窗口的更新属性 7.column()行 id即是对应table(column行)里的行次,名称(name)可以随便命名,也可以没有,则默认为table(column行)里的name 8.
com
pute()行 计算列,可以通过表达式计算显示特定值(具体函数可以见共享里的画笔函数). 9.text()行 有时可以代替计算列; 通过定义text的表达式,可以实现一列中显示两个字段值,注意结果必须要转换成string类型(而column和
com
pute则不行); 10.htmltable()行 按照格式导出(saveas)html文件,为了保证格式的完整,数据窗口的单位最好设置成pixels GenerateCSS='1' //保持格式及颜色 Border='0' //不要table边框 CellSpacing='0' //单元格无间距(此项在界面上经常设置不上) 注: (1)Grid生成标签,Freeform生成
+
标签; (2)生成htmltable时,不知为何会在CSS中的开始自动加一个分号";",导致excel等浏览器打开不能正常显示格式; (3)band为foreground或background的对象导不出来,可以动态修改后再导出. 11.export.xml()行 定义导出xml文件的格式,并为模板保存名称 使用时一定要设置usetemplate值 12.import.xml()行 定义导入xml文件的格式,并为模板保存名称 使用时一定要设置usetemplate值 13.表达式介绍 略 14.其它也略
Pb中实现自动换行
详细介绍如何在PB中实现文本框内文字的自动换行
pb数据窗口edit sourse说明
pb数据窗口edit sourse说明
用数据窗口做跑马灯(转帖)
$PBExport
Com
ments$用数据窗口做跑马灯 release 7;
data
window
(units=1 timer_interval=10 color=15780518 processing=0 HTMLDW=no print.documentname="" print.orientation = 0 print.margin.left = 24 print.margin.right = 24 print.margin.top = 24 print.margin.bottom = 24 print.paper.source = 0 print.paper.size = 0 print.prompt=no print.buttons=no print.preview.buttons=no ) summary(height=0 color="536870912" ) footer(height=0 color="536870912" ) detail(height=87 color="536870912" ) table(column=(type=char(10) updatewhereclause=yes name=s dbname="s" ) ) text(band=header alignment="1" text="S:" border="0" color="0" x="13" y="6" height="14" width="18" name=s_t font.face="宋体" font.height="-9" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" ) column(band=detail id=1 alignment="0" tabsequence=10 border="0" color="0" x="2" y="32" height="1" width="16" format="[general]" name=s edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="宋体" font.height="-9" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" ) text(band=detail alignment="0" text="现在跑马灯可以用了!" border="0" color="8421376" x="0~t333 - (long(left(right(string(t),4),3))) /1.5" y="0" height="33" width="279" name=t_1 font.face="Arial" font.height="-20" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
com
pute(band=summary alignment="0" expression="left(string(cpu()) + string(today(),'yyyymmdd'),len(string(cpu()) + string(today(),'yyyymmdd')) -8)"border="0" color="0" x="43" y="11" height="19" width="371" format="[general]" name=t visible="1~t0" font.face="Arial" font.height="-12" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" ) text(band=detail alignment="0" text="/*truncate((long(left(right(string(t),4),3)) /50),0) * 50* (rgb(255,255,255) /1000)*/rand(100)/100 * rgb(255,255,255)" border="0" color="16711935" x="1" y="44" height="14" width="1418" name=t_2 font.face="Arial" font.height="-8" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" ) text(band=detail alignment="0" text="333 - (long(left(right(string(t),4),3))) /1.5" border="0" color="16711935" x="0" y="66" height="14" width="508" name=t_3 font.face="Arial" font.height="-8" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" ) htmltable(border="1" ) htmlgen(clientevents="1" clientvalidation="1" client
com
putedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" )
DataWindow
611
社区成员
20,469
社区内容
发帖
与我相关
我的任务
DataWindow
PowerBuilder DataWindow
复制链接
扫一扫
分享
社区描述
PowerBuilder DataWindow
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章