× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



It is not ISO compliant.  For example:
select mydate,week(mydate)
from rob/a7
will return:
MYDATE    WEEK ( MYDATE )
01/01/00               1
01/02/00               2
01/03/00               2
01/04/00               2
01/01/02               1
01/06/02               2
01/07/02               2

Two problems:
1)  01/01/00 was on a Saturday.  Thus the first week began with Monday
01/03/00.
2)  Sunday's are the last day of a week, not the first.


But maybe this will be 'good enough', or 'what the requestor intended' for
the project.

But, who wants to rock the boat and get IBM to get their SQL to be ISO
compliant, or did ISO bend the rules for week within a SQL function?  Or
would the populace be more upset if it worked as ISO intended, versus how
we normally think?

Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin



                    "Marc Cras"
                    <MCRAS@mail.gates       To:     <rpg400-l@midrange.com>
                    .com>                   cc:
                    Sent by:                Fax to:
                    rpg400-l-admin@mi       Subject:     Re: Week Number Coding
                    drange.com


                    02/18/2002 11:15
                    AM
                    Please respond to
                    rpg400-l






Sorry,

WEEH( date) should be WEEK(date)

MarcC

>>> MCRAS@mail.gates.com 18/02/02 17:00:37 >>>
If you can use SQl , there a scalar function called WEEH( date ) .
This will do the trick. Their was an example in the Iseries News issue of
October 2001.


Marc Cras

Gates Europe N.V.
Belgium

Tel : + 32-(0)53-762 756

E-mail : mcras@gates.com








As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.