What date was the 1st Tuesday of last month . . .

Paul Howard paul@synergy.co.za
Mon, 13 Nov 2000 10:26:48 +0200


Hi Richard,
There are many ways to skin this particular cat, here is one....

define FIRST_DAY_OF_PREVIOUS_MONTH date = &
     (floor(date(days(lastday(sysdate)) - 32) / 100) * 100) + 01
define FIRST_TUESDAY date = date(days(FIRST_DAY_OF_PREVIOUS_MONTH + &
       index('106543',ascii(mod(days(FIRST_DAY_OF_PREVIOUS_MONTH),7)))))

Regards
Paul

-----Original Message-----
From: Latimer, Richard [mailto:richard.latimer@airways.co.nz]
Sent: Sunday, November 12, 2000 10:09 PM
To: 'powerh-l@sphere.swau.edu'
Subject: What date was the 1st Tuesday of last month . . .


Greetings listers!

I have been asked to produce a report to run (as part of a month end batch
job) on the third working day of each month that supplies data for the first
TUESDAY of the preceding month and another that supplies data for the
subsequent weekend.

The reports themselves exist and only require changes to the choose
statements and we already have a technique to supply updated 'chooses' to
reports which I will reuse:

exe report1      ; disk output to 1 line file " choose date <date 1> "
exe report 2 nogo
use <output of report 1>
go


My problem is an easy way to determine the date of the first Tuesday in the
preceding month based on either the system date OR I have available, in a
control file, the end date of the reporting month. 

Thanks in advance!


Richard Latimer
Wellington MIS Manager
Airways New Zealand
DDI + 64 4  471-4744
FAX + 64 4 471-0395
----------------------------------------------------------------------------
-----------
The opinions expressed are my own, well most of them are mine.  
OK some of the opinions are mine . . . 
At least the opinions expressed are not those of my employer.
I have high hopes of getting an opinion in the near future!
----------------------------------------------------------------------------
-----------

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.