That's better. It wasn't the ';' in the last one that caused the problem -
especially with a generic routine - it was the reliance on the date format
being m/d/y (which Dave's original noted).

Not sure why you're trying so hard to compress the lines. This routine will
easily fit in pretty much any screen...

I actually liked the 32 better. It just seemed to make a clearer connection
to "next month" for me.

-----Original Message-----
From: Wjhonson


I changed Marco's code slightly using Oconv to make it more clear what DD is
doing and make it more generic
I'm also adding 40 instead of 32 to make it clear that we don't care how
much we are adding as long as it's between 32 and 57
To make it clear what this is doing, we are taking the internal date, and
subtracting from that the "day number" on which we are running.
This will *always* give you the last day of the previous month.  Always.
Then we add enough to jump us into the next month anywhere, doesn't matter
at all.
And then do the same trick again, which will *always* give you the last day
of the month in which you are running
This is a fantastic bit of magic.


       TODAY = DATE() ; LAST.MO.END = TODAY - OCONV(TODAY,'DD')
       A.DAY.NEXT.MO = LAST.MO.END + 40
       END.OF.MO.DATE = A.DAY.NEXT.MO - OCONV(A.DAY.NEXT.MO,'DD')


_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to