|
Here is a procedure that I use to get the day of the week. It returns a
number starting with Sunday. We don't use date fields in our database so
that's why the move is there.
Hdatedit(*ymd) nomain
DgetDOW PR 5i 0
D 8s 0 CONST
Didx S 5i 0
Ddate S D datfmt(*ISO)
PgetDOW B Export
DgetDOW PI 5i 0
D wrkdate 8s 0 CONST
C *iso MOVE wrkdate date
C/exec sql set :idx = dayofweek(:date)
C/end-exec
C RETURN idx
P E
Thanks,
Mark
Mark Walter
Sr. Programmer/Analyst
Hanover Wire Cloth a div of CCX, Inc.
mwalter@hanoverwire.com
http://www.hanoverwire.com
717.637.3795 Ext.3040
/"\
\ /
X
/ \
rick.pezzimenti@de
nso.com.au To: rpg400-l@midrange.com
Sent by: cc:
rpg400-l-admin@mid Subject: Re: Day of the week
range.com
12/10/2002 10:27
PM
Please respond to
rpg400-l
This is a multipart message in MIME format.
--
--
[ Picked text/plain from multipart/alternative ]
Not sure if it has been mentioned here, but chap by the name of Zeller had
a formula for finding the day of the week for any date. Do a search on
google for "zeller's congruence" and it should turn up quite a few
results. Alternatively, have a look here
http://www.sciencenet.org.uk/database/Maths/Original/m00030d.html
I believe it only works on dates between 1562-3999, which should be ok for
your purpose I would think!
Cheers
#########################################################################
Attention:
The information contained in this message and or attachments is intended
only for the person or entity to which it is addressed and may contain
confidential and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient
is prohibited. Opinions expressed in this email and any attachment are
those of the sender and not necessarily the opinions of DENSO. If you
received this in error, please contact the sender and delete the material
from any system and destroy any copies.
The DENSO Australia Group of companies does not represent, warrant or
guarantee that the integrity of this communication has been maintained
nor that the communication is free of errors, virus or interference.
##########################################################################
--
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.