回复 10楼 wjp456789
非常感谢!
想学好VFP,想做VFP高手,想帮助更多的人解决VFP问题!
SELECT 工号,姓名,部门名称,工作时间,进厂时间,岗位名称,; INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1) as 工作年限,; IIF(INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)>=1 AND INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)<10,5.00,; IIF(INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)>=10 AND INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)<20,10.00,; IIF(INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)>=20,15.00,0))) as 年休假天数,; 上年未休,一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,; roun(VAL(上年未休),1)+roun(val(年休假天数),1) as 本年应休,; VAL(一月)+VAL(二月)+VAL(三月)+VAL(四月)+VAL(五月)+VAL(六月)+VAL(七月)+VAL(八月)+VAL(九月)+VAL(十月)+VAL(十一月)+VAL(十二月) as 合计,; roun(VAL(上年未休),1)+roun(val(年休假天数),1)-roun(VAL(一月)+VAL(二月)+VAL(三月)+VAL(四月)+VAL(五月)+VAL(六月)+VAL(七月)+VAL(八月)+VAL(九月)+VAL(十月)+VAL(十一月)+VAL(十二月),1) as 年休假剩余 FROM 年休假汇总表 INTO CURSOR lsb BROWSE
SELECT 工号,姓名,部门名称,工作时间,进厂时间,岗位名称,; INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1) as 工作年限,; IIF(INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)>=1 AND INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)<10,5.00,; IIF(INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)>=10 AND INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)<20,10.00,; IIF(INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)>=20,15.00,0))) as 年休假天数,; 上年未休,一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,; roun(VAL(allt(上年未休)),1)+int(IIF(INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)>=1 AND INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)<10,5.00,; IIF(INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)>=10 AND INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)<20,10.00,; IIF(INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)>=20,15.00,0)))) as 本年应休,; VAL(一月)+VAL(二月)+VAL(三月)+VAL(四月)+VAL(五月)+VAL(六月)+VAL(七月)+VAL(八月)+VAL(九月)+VAL(十月)+VAL(十一月)+VAL(十二月) as 合计,; roun(VAL(上年未休),1)+roun(IIF(INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)>=1 AND INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)<10,5.00,; IIF(INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)>=10 AND INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)<20,10.00,; IIF(INT(YEAR(DATE())-VAL(SUBSTR(工作时间,1,4))-1)>=20,15.00,0))),1)-roun(VAL(一月)+VAL(二月)+VAL(三月)+VAL(四月)+VAL(五月)+VAL(六月)+VAL(七月)+VAL(八月)+VAL(九月)+VAL(十月)+VAL(十一月)+VAL(十二月),1) as 年休假剩余 FROM 年休假汇总表 INTO CURSOR lsb BROWSE