Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Time() subtract
Message
From
16/08/2004 15:38:27
 
 
To
16/08/2004 14:44:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00933602
Message ID:
00933664
Views:
25
Hello, Mohammed
I was looking at just the second line of your code. you have:
  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.

hope that helps you.
Beth

>hello,
>
>thank you for reply.
>
>this is the code , what i can do,
>thisform.text2.value,thisform.text1.value,Thisform.text3.value (data type is character)
>
>
>
>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
>
>
>
>thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform