Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subtracting times
Message
De
30/10/2003 06:50:08
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00844412
Message ID:
00844449
Vues:
33
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform