你这样设置两个OPTIONGROUP是有逻辑问题的。
在COMMAND7.CLICK里写代码
year1=thisform.combo1.value
year2=thisform.combo3.value
year3=thisform.combo5.value
moon1=thisform.combo2.value
moon2=thisform.combo4.value
moon3=thisform.combo6.value
cExprL=".T."
do case
case thisform.optiongroup1.value=1
cExprL=cExprL+".AND.日期="+STR(year1*100+moon1,6)
case thisform.optiongroup1.value=2
cExprL=cExprL+".AND.日期>="+STR(year1*100+moon1,6)+".AND.日期<="+STR(year2*100+moon2,6)
case thisform.optiongroup1.value=3
cExprL=cExprL+".AND.日期="+STR(year1*100+moon1,6)+".AND.日期="+STR(year2*100+moon2,6)
endcase
do case
case thisform.optiongroup2.value=1
case thisform.optiongroup2.value=2
cExprL=cExprL+".AND.日期>="+STR(year2*100+moon2,6)+".AND.日期<="+STR(year3*100+moon3,6)
case thisform.optiongroup2.value=3
cExprL=cExprL+".AND.日期="+STR(year3*100+moon3,6)
endcase