* BASICALLY, GET TO THE FIRST OF NEXT MONTH
*   THEN BACK UP ONE DAY

  TODAY      = ICONV("12/15/11","D2/") ; * SAMPLE DATE
  THIS.MONTH = OCONV(TODAY,"DM")       ; * GET 'THIS' MONTH NUMBER
  LAST.DAY   = TODAY                   ; * ASSUME TODAY IS THE LAST DAY

  LOOP
    IF OCONV(LAST.DAY,"DM") # THIS.MONTH THEN ; * CHANGE IN MONTH?
      LAST.DAY -= 1                           ; * BACK UP A DAY
      EXIT                                    ; * DONE
    END

    LAST.DAY += 1                             ; * GO FORWARD A DAY
  REPEAT

Sincerely,
David Laansma
IT Manager
Hubbard Supply Co.
Direct: 810-342-7143
Office: 810-234-8681
Fax: 810-234-6142
www.hubbardsupply.com
"Delivering Products, Services and Innovative Solutions"


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Monday, December 05, 2011 2:22 PM
To: U2 Users List
Subject: Re: [U2] End of Month date routine

Here's one I use.

TODAY = OCONV(DATE(), "D4/")
MO = FIELD(TODAY, "/", 1)
YR = FIELD(TODAY, "/", 3)
MO += 1
IF MO > 12 THEN
   MO = 1
   YR += 1
END
EOM = OCONV((ICONV(MO:"/":"1":YR) - 1), "D4/")

Charles Shaffer
Senior Analyst
NTN-Bower Corporation



From:   Wjhonson <[email protected]>
To:     [email protected], 
Date:   12/05/2011 01:03 PM
Subject:        [U2]  End of Month date routine
Sent by:        [email protected]




Does someone have a routine that, no matter what day you run it, returns
the End of Month Date ?
(Assume the end of month date, is the calendar end of month date not
some screwy business date)
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

--
This email was Anti Virus checked by Astaro Security Gateway. 
http://www.astaro.com

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to