回复 5楼 hyswcyh
经过反复查找,终于找到问题了。
Pxq=ALLTRIM(CDOW(DATE(2017,3,1)))
VFP环境里显示Wednesday
Windows里显示星期三
程序里是用英文星期控制,所以结果不一致。
谢谢大家!我顺便把代码发出来,大家共勉
自动产生一年12个月的每天日期和星期,关判断润平年。
IF USED('RqK')
SELECT Rqk
USE
ENDIF
SELECT 0
USE dbf\Rqk
SELECT rqk
SET ORDER TO dts1
Pyear=YEAR(DATE())
for j=1 to 12
pmonth=j
Pxq=''
Ok=.f.
if mod(pyear,4)=0
ok=.t.
if mod(pyear,100)=0
ok=.f.
if mod(pyear,400)=0
ok=.t.
endif
endif
endif
if ok
pday=29
else
pday=28
endif
DO CASE
CASE pmonth=1
Pyue1=ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'+ALLTRIM(Pks)
SEEK pyue1
IF FOUND()
RETURN
else
i=1
DO WHILE i<=31
Pxq=ALLTRIM(CDOW(DATE(Pyear,Pmonth,i)))
IF (i=1) OR (pxq='Monday')
SELECT Rqk
APPEND BLANK
REPLACE keyid WITH Pks,dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
DO CASE
CASE pxq='Monday'
REPLACE dow1 WITH ALLTRIM(STR(i,2))
CASE pxq='Tuesday'
REPLACE dow2 WITH ALLTRIM(STR(i,2))
CASE pxq='Wednesday'
REPLACE dow3 WITH ALLTRIM(STR(i,2))
CASE pxq='Thursday'
REPLACE dow4 WITH ALLTRIM(STR(i,2))
CASE pxq='Friday'
REPLACE dow5 WITH ALLTRIM(STR(i,2))
CASE pxq='Saturday'
REPLACE dow6 WITH ALLTRIM(STR(i,2))
CASE pxq='Sunday'
REPLACE dow7 WITH STR(i,2)
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
ENDCASE
i=i+1
ENDDO
IF CDOW(DATE(Pyear,Pmonth,31))<>'Sunday'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
ENDIF
endif
CASE pmonth=2
Pyue1=ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'+ALLTRIM(pks)
SEEK pyue1
IF FOUND()
RETURN
else
i=1
DO WHILE i<=pday
Pxq=CDOW(DATE(Pyear,Pmonth,i))
IF (i=1) OR (pxq='Monday')
SELECT Rqk
APPEND BLANK
REPLACE keyid WITH pks,dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
DO CASE
CASE pxq='Monday'
REPLACE dow1 WITH STR(i,2)
CASE pxq='Tuesday'
REPLACE dow2 WITH STR(i,2)
CASE pxq='Wednesday'
REPLACE dow3 WITH STR(i,2)
CASE pxq='Thursday'
REPLACE dow4 WITH STR(i,2)
CASE pxq='Friday'
REPLACE dow5 WITH STR(i,2)
CASE pxq='Saturday'
REPLACE dow6 WITH STR(i,2)
CASE pxq='Sunday'
REPLACE dow7 WITH STR(i,2)
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
ENDCASE
i=i+1
ENDDO
IF CDOW(DATE(Pyear,Pmonth,pday))<>'Sunday'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
endif
CASE pmonth=3
Pyue1=ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'+ALLTRIM(pks)
SEEK pyue1
IF FOUND()
RETURN
else
i=1
DO WHILE i<=31
Pxq=CDOW(DATE(Pyear,Pmonth,i))
IF (i=1) OR (pxq='Monday')
SELECT Rqk
APPEND BLANK
REPLACE keyid WITH pks, dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
DO CASE
CASE pxq='Monday'
REPLACE dow1 WITH STR(i,2)
CASE pxq='Tuesday'
REPLACE dow2 WITH STR(i,2)
CASE pxq='Wednesday'
REPLACE dow3 WITH STR(i,2)
CASE pxq='Thursday'
REPLACE dow4 WITH STR(i,2)
CASE pxq='Friday'
REPLACE dow5 WITH STR(i,2)
CASE pxq='Saturday'
REPLACE dow6 WITH STR(i,2)
CASE pxq='Sunday'
REPLACE dow7 WITH STR(i,2)
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
ENDCASE
i=i+1
enddo
IF CDOW(DATE(Pyear,Pmonth,31))<>'Sunday'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
endif
CASE pmonth=4
Pyue1=ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'+ALLTRIM(pks)
SEEK pyue1
IF FOUND()
RETURN
else
i=1
DO WHILE i<=30
Pxq=CDOW(DATE(Pyear,Pmonth,i))
IF (i=1) OR (pxq='Monday')
SELECT Rqk
APPEND BLANK
REPLACE keyid WITH pks,dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
DO CASE
CASE pxq='Monday'
REPLACE dow1 WITH STR(i,2)
CASE pxq='Tuesday'
REPLACE dow2 WITH STR(i,2)
CASE pxq='Wednesday'
REPLACE dow3 WITH STR(i,2)
CASE pxq='Thursday'
REPLACE dow4 WITH STR(i,2)
CASE pxq='Friday'
REPLACE dow5 WITH STR(i,2)
CASE pxq='Saturday'
REPLACE dow6 WITH STR(i,2)
CASE pxq='Sunday'
REPLACE dow7 WITH STR(i,2)
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
ENDCASE
i=i+1
ENDDO
IF CDOW(DATE(Pyear,Pmonth,30))<>'Sunday'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
endif
CASE pmonth=5
Pyue1=ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'+ALLTRIM(pks)
SEEK pyue1
IF FOUND()
RETURN
else
i=1
DO WHILE i<=31
Pxq=CDOW(DATE(Pyear,Pmonth,i))
IF (i=1) OR (pxq='Monday')
SELECT Rqk
APPEND BLANK
REPLACE keyid WITH pks,dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
DO CASE
CASE pxq='Monday'
REPLACE dow1 WITH STR(i,2)
CASE pxq='Tuesday'
REPLACE dow2 WITH STR(i,2)
CASE pxq='Wednesday'
REPLACE dow3 WITH STR(i,2)
CASE pxq='Thursday'
REPLACE dow4 WITH STR(i,2)
CASE pxq='Friday'
REPLACE dow5 WITH STR(i,2)
CASE pxq='Saturday'
REPLACE dow6 WITH STR(i,2)
CASE pxq='Sunday'
REPLACE dow7 WITH STR(i,2)
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
ENDCASE
i=i+1
enddo
IF CDOW(DATE(Pyear,Pmonth,31))<>'Sunday'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
endif
CASE pmonth=6
Pyue1=ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'+ALLTRIM(Pks)
SEEK pyue1
IF FOUND()
RETURN
else
i=1
DO WHILE i<=30
Pxq=CDOW(DATE(Pyear,Pmonth,i))
IF (i=1) OR (pxq='Monday')
SELECT Rqk
APPEND BLANK
REPLACE keyid WITH pks, dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
DO CASE
CASE pxq='Monday'
REPLACE dow1 WITH STR(i,2)
CASE pxq='Tuesday'
REPLACE dow2 WITH STR(i,2)
CASE pxq='Wednesday'
REPLACE dow3 WITH STR(i,2)
CASE pxq='Thursday'
REPLACE dow4 WITH STR(i,2)
CASE pxq='Friday'
REPLACE dow5 WITH STR(i,2)
CASE pxq='Saturday'
REPLACE dow6 WITH STR(i,2)
CASE pxq='Sunday'
REPLACE dow7 WITH STR(i,2)
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
ENDCASE
i=i+1
enddo
IF CDOW(DATE(Pyear,Pmonth,30))<>'Sunday'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
endif
CASE pmonth=7
Pyue1=ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'+ALLTRIM(pks)
SEEK pyue1
IF FOUND()
RETURN
else
i=1
DO WHILE i<=31
Pxq=CDOW(DATE(Pyear,Pmonth,i))
IF (i=1) OR (pxq='Monday')
SELECT Rqk
APPEND BLANK
REPLACE keyid WITH pks ,dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
DO CASE
CASE pxq='Monday'
REPLACE dow1 WITH STR(i,2)
CASE pxq='Tuesday'
REPLACE dow2 WITH STR(i,2)
CASE pxq='Wednesday'
REPLACE dow3 WITH STR(i,2)
CASE pxq='Thursday'
REPLACE dow4 WITH STR(i,2)
CASE pxq='Friday'
REPLACE dow5 WITH STR(i,2)
CASE pxq='Saturday'
REPLACE dow6 WITH STR(i,2)
CASE pxq='Sunday'
REPLACE dow7 WITH STR(i,2)
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
ENDCASE
i=i+1
enddo
IF CDOW(DATE(Pyear,Pmonth,31))<>'Sunday'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
endif
CASE pmonth=8
Pyue1=ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'+ALLTRIM(pks)
SEEK pyue1
IF FOUND()
RETURN
else
i=1
DO WHILE i<=31
Pxq=CDOW(DATE(Pyear,Pmonth,i))
IF (i=1) OR (pxq='Monday')
SELECT Rqk
APPEND BLANK
REPLACE keyid WITH pks,dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
DO CASE
CASE pxq='Monday'
REPLACE dow1 WITH STR(i,2)
CASE pxq='Tuesday'
REPLACE dow2 WITH STR(i,2)
CASE pxq='Wednesday'
REPLACE dow3 WITH STR(i,2)
CASE pxq='Thursday'
REPLACE dow4 WITH STR(i,2)
CASE pxq='Friday'
REPLACE dow5 WITH STR(i,2)
CASE pxq='Saturday'
REPLACE dow6 WITH STR(i,2)
CASE pxq='Sunday'
REPLACE dow7 WITH STR(i,2)
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
ENDCASE
i=i+1
ENDDO
IF CDOW(DATE(Pyear,Pmonth,31))<>'Sunday'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
endif
CASE pmonth=9
Pyue1=ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'+ALLTRIM(pks)
SEEK pyue1
IF FOUND()
RETURN
else
i=1
DO WHILE i<=30
Pxq=CDOW(DATE(Pyear,Pmonth,i))
IF (i=1) OR (pxq='Monday')
SELECT Rqk
APPEND BLANK
REPLACE keyid WITH pks,dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
DO CASE
CASE pxq='Monday'
REPLACE dow1 WITH STR(i,2)
CASE pxq='Tuesday'
REPLACE dow2 WITH STR(i,2)
CASE pxq='Wednesday'
REPLACE dow3 WITH STR(i,2)
CASE pxq='Thursday'
REPLACE dow4 WITH STR(i,2)
CASE pxq='Friday'
REPLACE dow5 WITH STR(i,2)
CASE pxq='Saturday'
REPLACE dow6 WITH STR(i,2)
CASE pxq='Sunday'
REPLACE dow7 WITH STR(i,2)
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
ENDCASE
i=i+1
enddo
IF CDOW(DATE(Pyear,Pmonth,30))<>'Sunday'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+'0'+ALLTRIM(STR(pmonth,2))+'月'
endif
endif
CASE pmonth=10
Pyue1=ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'+ALLTRIM(pks)
SEEK pyue1
IF FOUND()
RETURN
else
i=1
DO WHILE i<=31
Pxq=CDOW(DATE(Pyear,Pmonth,i))
IF (i=1) OR (pxq='Monday')
SELECT Rqk
APPEND BLANK
REPLACE keyid WITH pks,dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
endif
DO CASE
CASE pxq='Monday'
REPLACE dow1 WITH STR(i,2)
CASE pxq='Tuesday'
REPLACE dow2 WITH STR(i,2)
CASE pxq='Wednesday'
REPLACE dow3 WITH STR(i,2)
CASE pxq='Thursday'
REPLACE dow4 WITH STR(i,2)
CASE pxq='Friday'
REPLACE dow5 WITH STR(i,2)
CASE pxq='Saturday'
REPLACE dow6 WITH STR(i,2)
CASE pxq='Sunday'
REPLACE dow7 WITH STR(i,2)
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
ENDCASE
i=i+1
enddo
IF CDOW(DATE(Pyear,Pmonth,31))<>'Sunday'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
endif
endif
CASE pmonth=11
Pyue1=ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'+ALLTRIM(pks)
SEEK pyue1
IF FOUND()
RETURN
else
i=1
DO WHILE i<=30
Pxq=CDOW(DATE(Pyear,Pmonth,i))
IF (i=1) OR (pxq='Monday')
SELECT Rqk
APPEND BLANK
REPLACE keyid WITH pks,dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
endif
DO CASE
CASE pxq='Monday'
REPLACE dow1 WITH STR(i,2)
CASE pxq='Tuesday'
REPLACE dow2 WITH STR(i,2)
CASE pxq='Wednesday'
REPLACE dow3 WITH STR(i,2)
CASE pxq='Thursday'
REPLACE dow4 WITH STR(i,2)
CASE pxq='Friday'
REPLACE dow5 WITH STR(i,2)
CASE pxq='Saturday'
REPLACE dow6 WITH STR(i,2)
CASE pxq='Sunday'
REPLACE dow7 WITH STR(i,2)
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
ENDCASE
i=i+1
ENDDO
IF CDOW(DATE(Pyear,Pmonth,30))<>'Sunday'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
endif
endif
CASE pmonth=12
Pyue1=ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'+ALLTRIM(pks)
SEEK pyue1
IF FOUND()
RETURN
ELSE
i=1
DO WHILE i<=31
Pxq=CDOW(DATE(Pyear,Pmonth,i))
IF (i=1) OR (pxq='Monday')
SELECT Rqk
APPEND BLANK
REPLACE keyid WITH pks,dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
endif
DO CASE
CASE pxq='Monday'
REPLACE dow1 WITH STR(i,2)
CASE pxq='Tuesday'
REPLACE dow2 WITH STR(i,2)
CASE pxq='Wednesday'
REPLACE dow3 WITH STR(i,2)
CASE pxq='Thursday'
REPLACE dow4 WITH STR(i,2)
CASE pxq='Friday'
REPLACE dow5 WITH STR(i,2)
CASE pxq='Saturday'
REPLACE dow6 WITH STR(i,2)
CASE pxq='Sunday'
REPLACE dow7 WITH STR(i,2)
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
ENDCASE
i=i+1
enddo
IF CDOW(DATE(Pyear,Pmonth,31))<>'Sunday'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '08:00-12:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '14:00-18:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
appe blank
REPLACE keyid WITH Pks,ppsj WITH '18:00-08:00',dts1 WITH ALLTRIM(STR(pyear,4))+'年'+ALLTRIM(STR(pmonth,2))+'月'
endif
endif
ENDCASE
ENDFOR