Thanks John. Your routine below can be a little more efficient by using the DD conversion which returns the day number IF OCONV(DATE()+1,'DD) = 1 THEN CRT 'This is the last day...'
etc Also, You don't need to add one, Universe handles the string to numeric properly even though the string is '01' -----Original Message----- From: John Thompson <[email protected]> To: U2 Users List <[email protected]> Sent: Mon, Dec 5, 2011 11:16 am Subject: Re: [U2] End of Month date routine This may not be the cleanest way, but, we use it here and it works. used ABORT, so some parent program or paragraph would not keep executing. IF FIELD(OCONV(DATE()+1,"D2/"),"/",2) + 0 = 1 THEN CRT 'This IS the last day of the month.' CRT 'ABORTING END OF DAY' ABORT END ELSE CRT 'This is NOT the last day of the month' CRT 'Running End of Day' END Whatever you do... Do it in BASIC. Don't go down the road of unix shell cripting unless you love that stuff. On Mon, Dec 5, 2011 at 2:08 PM, Dave Davis <[email protected]>wrote: > Month = Oconv(current.date,'DM') ;* find month Year = Oconv(current.date,'DY') ;* find year Month = Month + 1 ;* find next month If (Month > 12) then Month = 1 Year = Year + 1 End FirstDayNextMonth = Iconv(Month:"/01/":Year,'D') ;* assumes MM/DD/YYYY format LastDayThisMonth = FirstDayNextMonth - 1 ;* self-explanatory. -----Original Message----- From: [email protected] [mailto: [email protected]] On Behalf Of Wjhonson Sent: Monday, December 05, 2011 2:03 PM To: [email protected] Subject: [U2] End of Month date routine 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 ________________________________ Dave Davis Team Lead, R&D P: 614-875-4910 x108 F: 614-875-4088 E: [email protected] [http://www.harriscomputer.com/images/signatures/HarrisSchools.gif] [http://www.harriscomputer.com/images/signatures/DivisionofHarris.gif]< http://www.harriscomputer.com/> 6110 Enterprise Parkway Grove City, OH 43123 www.harris-schoolsolutions.com<http://www.harris-schoolsolutions.com> This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message. _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users -- ohn Thompson ______________________________________________ 2-Users mailing list [email protected] ttp://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
