[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Date-time math



With SQR 4 there is a DATEDIFF function.  However, it returns a float value,
not a time-value.  The documentation states,

Returns the difference between the specified dates expressed in units_value.
The function returns a float value.  The result can be negative if the first
date is earlier than the second date.

Syntax: dst_var = datediff(date1_value, date2_value, units_value)
 date1_value = date variable, or expression
date2_value = date variable, or expression
 units_value = text literal, column, variable, or expression. Valid units
are 'year', 'quarter', 'week', 'month', 'day', 'hour', 'minute', and
'second'.
 dst_var = decimal, float, or integer variable

Example: let #diff = datediff($date1, $date2, 'hour')



-----Original Message-----
From: Steven Steele <Steven_Steele@CCNOTES.CCITY.COM>
To: Multiple recipients of list SQR-USERS <SQR-USERS@list.iex.net>
Date: October 20, 1998 8:40 AM
Subject: Date-time math


Hi All,
Can anyone point me to an sqc that calculates differences (including hours
and minutes) between two date-time fields?

Thanks,
Steve