i've not read this entire thread so someone may have said this  but i get the 
first day of the next month and then -1
 
works a treat

        -----Original Message----- 
        From: [EMAIL PROTECTED] on behalf of Marco Manyevere 
        Sent: Fri 03/06/2005 09:40 
        To: [email protected] 
        Cc: 
        Subject: Re: [U2] Finding last day of month
        
        

        Will,
        
        This was exactly my method, except I was adding 35 days (it could have 
been 30 as well) to the first day of the month to get to next month.
        
        I also dislike the lookup table idea  i.e. 31,28,30,31,etc, the leap 
year or 12th month logic.
        
        Thanks for all the responses guys.
        
        [EMAIL PROTECTED] wrote:
        Ok smartass you say let's see you do it ....
        
        First of all, you can always get from the month you are in, to the next 
month
        by simply add 30 days to the middle of the month. And you never need to
        worry about leap years nor about 12th month logic
        
        Input Date ; * format yyyymmdd
        Middleofthismonth = date[1,6]:'15'
        I.Middle = Iconv(Middleofthismonth,'D')
        I.Next = I.Middle + 30
        NextMonth = Oconv(I.NEXT,'D2-')
        FirstDayNextMonth = NextMonth[1,2]:'01':NextMonth[5,2]
        I.FirstDay = Iconv(FirstDayNextMonth,'D')
        I.LastDayPreviousMonth = I.FirstDay - 1
        
        Now can we scrunch this down?
        Input Date ; *format yyyymmdd
        NextMonth = Oconv(Iconv(date[1,6]:'15','D') + 30,'D2')
        I.LastDayPreviousMonth = Iconv(NextMonth[1,2]:'01':NextMonth[5,2],'D') 
+ 1
        
        Do I win the big stuffed pickle?
        Will Johnson
        Fast Forward Technologies
        -------
        u2-users mailing list
        [email protected]
        To unsubscribe please visit http://listserver.u2ug.org/
        
                       
        ---------------------------------
        Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with 
voicemail
        -------
        u2-users mailing list
        [email protected]
        To unsubscribe please visit http://listserver.u2ug.org/
        
        ______________________________________________________________________
        This email has been scanned by the MessageLabs Email Security System.
        For more information please visit http://www.messagelabs.com/email
        ______________________________________________________________________
        


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

[demime 1.01d removed an attachment of type application/ms-tnef which had a 
name of winmail.dat]
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to