这个是统计按钮里的click代码:我现在要实现一个功能,就是“从几月到几月”的查询,比如说从1月到5月,让1月到5月的所有信息显示到grid里面,而且是任意组合的,比如是某个人,某个系等等的1月到5月的,请问该怎么改下面的代码。下面的代码除了我上面说的这个功能外,其他的任意组合都已经实现了!
exps=".t."
if not empty(thisform.container1.container2.姓名1.value)
exps=exps+'.and."'+alltrim(thisform.container1.container2.姓名1.value)+'"$姓名'
endif
if not empty(thisform.container1.container2.所在系部1.displayvalue)
exps=exps+'.and."'+alltrim(thisform.container1.container2.所在系部1.displayvalue)+'"$所在系部'
endif
if not empty(thisform.container1.container2.职称1.displayvalue)
exps=exps+'.and."'+alltrim(thisform.container1.container2.职称1.displayvalue)+'"$职称'
endif
if not empty(thisform.container1.container2.月份1.displayvalue)
exps=exps+'.and."'+alltrim(thisform.container1.container2.月份1.displayvalue)+'"$月份'
endif
if not empty(thisform.container1.container2.月份2.displayvalue)
exps=exps+'.and."'+alltrim(thisform.container1.container2.月份2.displayvalue)+'"$月份'
endif
IF Len(Exps)>10
Exps1=Substr(Exps,9)
ThisForm.container1.container2.Expression.Value=Exps1
EndIF
IF NOT Empty(ThisForm.container1.container2.Expression.Value)
Exprs=ThisForm.container1.container2.Expression.Value
Select * From 信息表 Where &Exprs Into Cursor Temp1
Else
Wait Window "没有指定任何条件!" NoWait
Select * From 信息表 Into Cursor Temp1
thisform.release
EndIF
ThisForm.container1.Grid1.RecordSourceType=1
ThisForm.container1.Grid1.RecordSource="Temp1"
ThisForm.container1.Grid1.ColumnCount=9
ThisForm.container1.Grid1.Column1.Header1.Caption="月份"
ThisForm.container1.Grid1.Column2.Header1.Caption="所在系部"
ThisForm.container1.Grid1.Column3.Header1.Caption="姓名"
ThisForm.container1.Grid1.Column4.Header1.Caption="性别"
ThisForm.container1.Grid1.Column5.Header1.Caption="职称"
ThisForm.container1.Grid1.Column6.Header1.Caption="ip地址"
ThisForm.container1.Grid1.Column7.header1.caption="流入量"
ThisForm.container1.Grid1.Column8.header1.caption="流出量"
ThisForm.container1.Grid1.Column9.header1.caption="费用统计"
ThisForm.container1.Grid1.Column1.Width=45
ThisForm.container1.Grid1.Column2.Width=70
ThisForm.container1.Grid1.Column3.Width=50
ThisForm.container1.Grid1.Column4.Width=40
ThisForm.container1.Grid1.Column5.Width=50
ThisForm.container1.Grid1.Column6.width=85
ThisForm.container1.Grid1.Column7.Width=65
ThisForm.container1.Grid1.Column8.Width=65
ThisForm.container1.Grid1.Column9.Width=70
[此贴子已经被作者于2006-5-23 9:39:43编辑过]