How-To calculate diiference in minutes from 2 DATETIME-fields
Posted in 1999
Topics: General Discussion
Hi,
Can anyone tell me how to calcute the minutes between 2
DATETIME-fields?
Example:
CREATE TABLE period (
employee_id integer NOT NULL,
project_id integer NOT NULL,
activity_id integer,
begin_period datetime YEAR TO MINUTE NOT NULL,
end_period datetime YEAR TO MINUTE NOT NULL,
PRIMARY KEY (employee_id,project_id,begin_period),
);
I want to calculate the interval between 'end_period' & 'begin_period'
for every record and insert it in the table.
Can I use the INTERVAL datatype?
John Leerentveld<jl@ibt.nl>
John Leerentveld wrote: > Hi, > Can anyone tell me how to calcute the minutes between 2 > DATETIME-fields? > I want to calculate the interval between 'end_period' & 'begin_period' > for every record and insert it in the table. > Can I use the INTERVAL datatype? Exactly. Use an INTERVAL minute(5) to minute. Art S. Kagel