pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch #5637] Implement DATESUM, DATEDIFF expression function


From: Ben Pfaff
Subject: Re: [patch #5637] Implement DATESUM, DATEDIFF expression function
Date: Sat, 16 Dec 2006 12:22:32 -0800
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

"Daniel E WILLIAMS" <address@hidden> writes:

> Thanks.  I think the arguments are backwards in the function call, if you are
> trying for SPSS compatibility.  SPSS uses the format DATEDIFF(last_date,
> first_date, unit).  I think you implemented DATEDIFF(first_date, last_date,
> unit).  I tried to find this in the code to fix myself, but am stumped.  Can
> you tell me where to look?  Thanks.

Well, that's an embarrassing bug.  I completely mis-read the SPSS
documentation, and I don't have an SPSS 15 license so I couldn't
check it.

I checked in your fix.

Would you mind checking a couple of things for me where the SPSS
documentation is ambiguous?  First: does time of day count for
DATEDIFF?  That is, is the difference in years between 1 Jan 2004
at 2pm and 1 Jan 2005 at 1pm zero years or one year?

Second: does time of day count for DATESUM?  That is, is 1 Jan
2004 at 1pm, plus one month, equal to 1 Feb 2004 at 1pm or at
midnight?

-- 
"I was born lazy.  I am no lazier now than I was forty years ago, 
 but that is because I reached the limit forty years ago.  You can't 
 go beyond possibility."
--Mark Twain




reply via email to

[Prev in Thread] Current Thread [Next in Thread]