Re: Days Between 2 Dates
Posted in 1998
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
Carl Hoang wrote:
> I'm looking for a function that gives me the days between the
> 2 dates. Any help is much appreciated. TIA.
SELECT date1 - date2 AS days_between FROM ... ?
CREATE PROCEDURE datediff(d1 DATE, d2 DATE) RETURNING INTEGER; RETURN d1 - d2;
END PROCEDURE;
Both should work -- I've not tested either before sending this message.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
#include <disclaimer.h>