tian=ALLTRIM(STR(INT(dtm/(60*60*24))))
shi=ALLTRIM(STR(INT(MOD(dtm,(60*60*24))/(60*60))))
fen=ALLTRIM(STR((dtm/60)%60))
假如dtm=32400时,为什么有时取余数时会等于60?
这是我的代码
fots_condition=fots_name+'="'+a1+'"'
_sqlfetch(fots_table2,fots_condition)
if used('sqlfetch')
select * from sqlfetch into array fot
for i=1 to alen(fot,1)
select * from db_fiesta where rq=ttod(fot(i,7)) into cursor ifld
select ifld
if .not. eof()
dt3=fot(i,8)-fot(i,7)
dtm3=dtm3+dt3
else
if dow(fot(i,7))=1 .or. dow(fot(i,7))=7
dt2=fot(i,8)-fot(i,7)
dtm2=dtm2+dt2
else
dt1=fot(i,8)-fot(i,7)
dtm1=dtm1+dt1
endif
endif
use
endfor
tian1=ALLTRIM(STR(INT(dtm1/(60*60*24))))
shi1=ALLTRIM(STR(INT(MOD(dtm1,(60*60*24))/(60*60))))
fen1=ALLTRIM(STR((dtm1/60)%60))
tian2=ALLTRIM(STR(INT(dtm2/(60*60*24))))
shi2=ALLTRIM(STR(INT(MOD(dtm2,(60*60*24))/(60*60))))
fen2=ALLTRIM(STR((dtm2/60)%60))
tian3=ALLTRIM(STR(INT(dtm3/(60*60*24))))
shi3=ALLTRIM(STR(INT(MOD(dtm3,(60*60*24))/(60*60))))
fen3=ALLTRIM(STR((dtm3/60)%60))
messagebox(tain1+'天'+shi1+':'+fen1+chr(13)+chr(10)+tain2+'天'+shi2+':'+fen2+chr(13)+chr(10)+tain3+'天'+shi3+':'+fen3)
else
messagebox('找不到记录')
endif