关于count语句嵌入select带来的问题
我想对一个表进行count 并嵌入到select 但要对count需进行筛选,我用了自定义函数,输出到grid中,可调试老是不对
下附相关代码
function countwork(tempnumber,temptype)
select inputduty
count all for inputduty.type = allt(str(temptype)) while inputduty.number = tempnumber to n1 &&统计
return n1
endfunc
grid的ini中
this.recordsource="select distinct people.name,inputduty.number, countwork(inputduty.number,1) from inputduty,people ;
into cursor tmlist where inputduty.number = people.number and people.part=allt(str(goapp.dep))"
请大家指正,因为刚接手一个vfp数据库的项目 对sql语言还比较生疏,大家多多帮忙