|
/eject P DayOfWeek B EXPORT ***** DayOfWeek - Calculates day of week (Monday = 1, Tuesday = 2, etc * - for any date. * - Input: WorkDate (Date field in *USA format) * - Result: WorkDay (Single digit numeric) D PI 1S 0 D WorkDate D CONST D AnySunday S D INZ(D'04/02/1995') D WorkNum S 7 0 D WorkDay S 1S 0 C WorkDate SubDur AnySunday WorkNum:*D C WorkNum Div 7 WorkNum C MvR WorkDay C If WorkDay < 1 C Return WorkDay + 7 C Else C Return WorkDay C EndIf P DayOfWeek E /eject *&*&*&*&*&*&**&* See also: /eject P DayNameL B EXPORT D DayNameL PI 9A D WorkDate D CONST D DS D DayData 42 Inz('Mon Tues Wednes+ D Thurs Fri Satur Sun ') D DayArray 6 Overlay(DayData) Dim(7) C Return %TrimR(DayArray(DayOfWeek(WorkDate))) + C 'day' P DayNameL E *&*&*&*&*&*&*&*&* See also: /eject P DayNameS B EXPORT D DayNameS PI 3A D WorkDate D CONST D DS D DayData 21 Inz('MonTueWedThuFriSatSun') D DayArray 3 Overlay(DayData) Dim(7) C Return %TrimR(DayArray(DayOfWeek(WorkDate))) P DayNameS E Rob Berendt, et al ron.klein@brctsg.com on 12/09/99 12:13:07 PM Please respond to MIDRANGE-L@midrange.com@Internet To: MIDRANGE-L@midrange.com@Internet cc: Fax to: Subject: Day of the week Hi all, Since we have a discusion going about the days of the month, how about a easy routine to find the day of the week? Any one have a solution? TIA Ron +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.