>Could anyone enlighten me on which is a better way
>to calculate the differences in 2 given times?
>
>Eg: 08:30 to 17:30 how to apply a formula that
>would calculate the difference is 9 hours? Thanks
If they're stored in DateTime formats, just subtract them; the difference is the difference in seconds (there's an issue with rounding that might vary by +/-1 second; taking the INT() of the difference before assigning the value seems to be a good workaround. There's information on this in the current issue of FoxPro Advisor.) Once you have a difference in seconds, it's trivial to convert to another measure of time by simple division; if the difference is not needed for computational purposes (in which case you need a numeric value IAC) and is < 1 day, the foillowing extracts the time string:
TTOC(DTOT(DATE() + nDiffInSeconds),2)
The string returns in accordance with the current SET conditions; see the VFP docs for the effects.