>i have a question for you any body can help me..
>i have two character fields in a column
>
> field 1 field 2
> start time end time
>like such 130100 130700
>
>what i need to do is the following sobstract field 1 from 2 and get elapsed time results in minutes and seconds like such 06:00 meaning 6 minutes and 00 seconds
>please help me achieve this task....i would really appreciate it.......thank you
If you are willing to change your time format to have characters with ":" the subtraction to get seconds becomes
nSecondsElapsed = int(val(ctot(cTime2) - ctot(cTime1)))
Converting this back to a character is
cMinSecElapsed = padl(alltrim(str(int(nSecondsElapsed/60))),2,"0")+":"+padl(alltrim(str(mod(nSecondsElapsed,60))),2,"0")
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only