Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Query/400 date arithmetic

92 views
Skip to first unread message

Sriram N. A.

unread,
Jan 27, 2001, 6:16:19 AM1/27/01
to
On our system, I am getting erroneous results with date arithmetic in
query/400 (WRKQRY):

A simple test would be to define three result fields:
TODAY CURRENT(DATE)
PREV TODAY - 2 MONTHS
@DIFF TODAY - PREV

@DIFF yields 200 days!

@DIFF should contain the number of days between the two dates - or have I
understood it wrong?

Sriram

Ken S.

unread,
Jan 27, 2001, 9:24:08 PM1/27/01
to
Hi Sriram -

On Sat, 27 Jan 2001 16:46:19 +0530, "Sriram N. A."
<srir...@in.bosch.com> wrote:

>@DIFF should contain the number of days between the two dates - or have I
>understood it wrong?

What you are getting is a result in the format of CCYYMMDD. With the
leading zeros suppressed, the 200 you are seeing means 2 months and 00
days.

Use the following to get what you want:
@DIFF DAYS(TODAY) - DAYS(PREV)

Ken
http://www.ke9nr.org/
Opinions expressed are my own and do not necessarily represent the views of my employer or anyone in their right mind.

0 new messages