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 sampleI 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) ENDPROCTherefore the field lapse time needs to show the difference. Where would I put this IF statement in this program please?