Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subtracting times
Message
From
30/10/2003 06:50:08
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00844412
Message ID:
00844449
Views:
31
>Thanks Gregory but sorry to be a pain.
>
>I have some SQL which produces the table:
>
>
>SELECT mainkey, key1, key2, key3, key4, moc014, moc016, chk10date, chk10date-chk1date as noofdays, ;
>firstdate,firsttime, chk1date, chk1time, chk1date-firstdate as datediff, GetTimeDiff(firsttime,chk1time) as lapsetime, ;
>1 as sampcnt from modacad ;
>WHERE chk1='X' AND chk10='X' AND key4='SAMPLE' ;
>ORDER BY mainkey ;
>INTO CURSOR crssample
>SELECT crssample
>SET DEFAULT TO 'c:\foxpro projects\statistics'
>COPY TO sample
>
>
>I then have the procedure stored in a program:
>
>PROCEDURE GetTimeDiff ( time1,time2 )
>RETURN TTOC({^1900/01/01 00:00} + (EVALUATE('{^1900/01/01 '+m.time2+'}')-EVALUATE('{^1900/01/01 '+m.time1+'}')),2)
>ENDPROC
>
>
>Therefore the field lapse time needs to show the difference. Where would I put this IF statement in this program please?
>
>Many Thanks

Neil,
RETURN TTOC({^1900/01/01 00:00} + mod( EVALUATE('{^1900/01/01 '+m.time2+'}')-EVALUATE('{^1900/01/01 '+m.time1+'}'),86400),2)
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform