有个数据表,数据是动态追加的,想查询最近6个月的病假累计数超过50天的人。
用vfp6.0sele xm,sum(bj) as bj from gg where sum(bj)>50 and (rq>20221 and rq<=202304) grou by xm 命令,提示"sum.prg"不存在。
请问老师如何做到能动态查询最近6个月的病假情况。谢谢!
sele xm,sum(bj) as bj from gg where sum(bj)>50 and (rq>20221 and rq<=202304) grou by xm
试试
sele xm,sum(bj) as bj from gg where between(rq, 202211,202304) grou by xm having sum(bj)>50
y=val(left(dtoc(GOMONTH(DATE(), -1),1),6))
yy=val(left(dtoc(GOMONTH(DATE(), -6),1),6))
sele xm,sum(bj) as bj from gg where between(rq, yy,y) grou by xm having sum(bj)>50