You can subtract one datetime from another and it will give you the number of seconds between them
x = DATETIME()
?datetime() - x
now it's just a matter of getting the number of hours, minutes and seconds...
LOCAL tFirstdatetime, tSecondDatetime, nDifference
LOCAL nHours, nMinutes, nSeconds
tFirstdatetime = DATETIME()
tSecondDatetime = {^2004/01/01 12:00 AM}
nDifference = tSecondDatetime - tFirstdatetime
nHours = MAX(INT(nDifference/3600),0)
nMinutes = MAX(INT((nDifference % 3600) / 60),0)
nSeconds = nDifference % 60
?"HOURS: " + TRANSFORM(nHours)
?"MINUTES: " + TRANSFORM(nMinutes)
?"SECONDS: " + TRANSFORM(nSeconds)
*!* Testing
*!* ?nDifference
*!* ?nHours * 3600 + nMinutes * 60 + nSeconds
Slighthaze = NULL
[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]