TTOC(CTOT(thisform.text2.value)- CTOT(thisform.text1.value)+{^2000/01/01:}I had to move the date part to the front of the code to get it to come up with a datetime to work with.
TTOC({^2000/01/01:} + CTOT(thisform.text2.value)- CTOT(thisform.text1.value)I did this, because the computer expects the datetime format to be date first, then time. You may want to rethink the date you are entering, because the default date is "12/30/1899" which causes your hours and minutes to be huge. Either you should put the date and the next date on the times before subtracting:
TTOC({^2000/01/01} + CTOT(thisform.text2.value)- {^2000/01/02} + CTOT(thisform.text1.value)Or, force the user to put in the date also.
>set hour to 24 > >STORE TTOC(CTOT(thisform.text2.value)- CTOT(thisform.text1.value)+{^2000/01/01:},2) to tResult&&Thisform.text3.value > >Thisform.text3.value = SUBSTR(tResult,1,5) >Z = Thisform.text3.value >STORE SUBSTR(z,1,2) TO thour >STORE SUBSTR(z,4,2) TO tMinute >nTime= tHour+"."+tMinute >VAL(nTime) >Thisform.text3.value = VAL(nTIME) >thisform.text6.value=thisform.text5.value*VAL(nTIME) >thisform.text11.value=thisform.text13.value*(CTOT(thisform.text10.value)-CTOT('0:'))/3600 >************************************************************* >if thisform.text10.value>space(10) .and. thisform.text1.value>space(10) .and. thisform.text2.value>space(10) >=messagebox("YOU ENTER RONG VALUE") >thisform.grid1.visible=.f. >else > >thisform.grid1.visible=.t. > > select 1 > *use table4 >APPEN BLANK >REPLACE dat WITH THISFORM.TEXT7.VALUE >REPLACE timEON WITH THISFORM.TEXT1.VALUE >REPLACE timEOF WITH THISFORM.TEXT2.VALUE >REPLACE REGULARHOU WITH tResult >REPLACE TOTAL WITH THISFORM.TEXT6.VALUE >REPLACE OVERTIME WITH THISFORM.TEXT10.VALUE >REPLACE TOTAL1 WITH (THISFORM.TEXT11.VALUE) > >*THISFORM.GRID1.REFRESH >THISFORM.TEXT1.SETFOCUS >*endif >*with thisform.Grid1 >*.Recordsource = .Recordsource >*endwith >thisform.Refresh > > thisform.text7.value= thisform.text7.value+1 > thisform.text8.value= (thisform.text8.value)+ val(SUBSTR(tResult,1,5)) > thisform.text9.value= (thisform.text8.value)* thisform.text5.value > > >ENDIF > >>