Actually that will not work for a date near the end of the month. Was trying to 
be too smart....

> -----Original Message-----
> From: Phil Walker
> Sent: Tuesday, 6 December 2011 10:47 a.m.
> To: 'U2 Users List'
> Subject: RE: [U2] End of Month date routine
> 
> 
> EOM = OCONV(ICONV(OCONV(@DATE+31,'D-YM[4,2]'):'-01','D-YMD[4,2,2')-
> 1,'D-YMD[4,2,2]')
> 
> 
> > -----Original Message-----
> > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> > boun...@listserver.u2ug.org] On Behalf Of Israel, John R.
> > Sent: Tuesday, 6 December 2011 10:29 a.m.
> > To: 'U2 Users List'
> > Subject: Re: [U2] End of Month date routine
> >
> > Agreed.  That code is almost verbatim what I have used for 20+ years,
> > and it has never failed me.
> >
> >
> >
> >
> >
> >
> >
> >
> > John Israel
> > Senior ERP Developer
> >
> > Dayton Superior Corporation
> > 1125 Byers Rd  Miamisburg, OH 45342
> > Office: 937-866-0711 x44380
> > Fax: 937-865-9182
> >
> > johnisr...@daytonsuperior.com
> >
> > This message w/attachments (message) is intended solely for the use of
> > the intended recipient(s) and may contain information that is
> > privileged, confidential or proprietary. If you are not an intended
> > recipient, please notify the sender, and then please delete and
> > destroy all copies and attachments, and be advised that any review or
> > dissemination of, or the taking of any action in reliance on, the
> > information contained in or attached to this message is prohibited.
> >
> >
> >
> >
> > -----Original Message-----
> > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> > boun...@listserver.u2ug.org] On Behalf Of Charlie Noah
> > Sent: Monday, December 05, 2011 4:27 PM
> > To: U2 Users List
> > Subject: Re: [U2] End of Month date routine
> >
> > I vote for the method (already posted) which will work every time on
> > any MV system, any flavor, any emulation: find the first day of the
> > next month and subtract 1. Messing around with adding 31, 32, etc.
> > will bite you sooner or later (well, it worked at my last job).
> >
> > Regards,
> >
> > Charlie Noah
> > Charles W. Noah Associates
> > cwn...@comcast.net
> >
> > <http://www.linkedin.com/in/charlienoah>
> >
> > The views and opinions expressed herein are my own (Charlie Noah) and
> > do not necessarily reflect the views, positions or policies of any of
> > my former, current or future employers, employees, clients, friends,
> > enemies or anyone else who might take exception to them.
> >
> >
> > On 12-05-2011 3:12 PM, Rick Nuckolls wrote:
> > > I think that with a slight modification, adding 31 works reasonably well.
> > >
> > > Just use the "DYM" conversion consistently through the program:
> > >
> > > To be concise, in Universe, for any internal date, "D", the internal
> > > form of
> > the last day of the month is:
> > >
> > > lastdayofmonth = iconv(oconv(iconv(oconv( D, 'DMY'), 'DMY') +31
> > > ,'DMY'),'DMY') -1
> > >
> > > "DYM" would work as well.
> > >
> > > Rick Nuckolls
> > > Lynden Inc
> > >
> > >> Doesn't work on my system Anthony.
> > >> The This month o gives the month and year ok but the attempt to
> > >> iconv that sets it to zero, it doesn't pad the "01" into it or
> > >> something so i just get 31 at that point.
> > >>
> > >> I think you were expecting that it would take "12 2011" and make it
> > >> into "12 01 2011" or whatever but it's not working
> > >>
> > >>
> > >>
> > >>
> > >> -----Original Message-----
> > >> From: George Gallen<ggal...@wyanokegroup.com>
> > >> To: U2 Users List<u2-users@listserver.u2ug.org>
> > >> Sent: Mon, Dec 5, 2011 12:10 pm
> > >> Subject: Re: [U2] End of Month date routine
> > >>
> > >>
> > >> Haven't checked it, but what happens on 01/31 by adding 31, it
> > >> should take you arch, backing up Will give you 02/xx (28 or 29)?
> > >> George
> > >> -----Original Message-----
> > >> rom: u2-users-boun...@listserver.u2ug.org
> > >> [mailto:u2-users-boun...@listserver.u2ug.org]
> > >> n Behalf Of Wols Lists
> > >> ent: Monday, December 05, 2011 3:05 PM
> > >> o: u2-users@listserver.u2ug.org
> > >> ubject: Re: [U2] End of Month date routine On 05/12/11 19:03,
> > >> Wjhonson wrote:
> > >>
> > >> Does someone have a routine that, no matter what day you run it,
> > >> returns the nd of Month Date ?
> > >> (Assume the end of month date, is the calendar end of month date
> > >> not some crewy business date) Hmmm... no-one seems to have done
> my
> > >> approach ...
> > >> TODAY = @DATE
> > >> HIS.MONTH.O = OCONV (TODAY, "DMY") ;* strip day off EXT.MONTH.I =
> > >> ICONV( THIS.MONTH.O, "D") + 31 ;* random day next month
> > EXT.MONTH.O =
> > >> OCONV( NEXT.MONTH.I, "DMY") ;* strip day off AST.DAY.I = ICONV(
> > >> NEXT.MONTH.O, "D") - 1 ;* subract one day If you don't have a day
> > >> in your i/oconv it defaults to 1, so the logic orks. Unfortunately
> > >> you can't combine the first three lines because here's no number
> > >> you can pick that will guarantee to land you in next onth whatever
> > >> today's date :-( Cheers, ol
> > ______________________________________________
> > >> 2-Users mailing list
> > >> 2-us...@listserver.u2ug.org
> > >> ttp://listserver.u2ug.org/mailman/listinfo/u2-users
> > >> ______________________________________________
> > >> 2-Users mailing list
> > >> 2-us...@listserver.u2ug.org
> > >> ttp://listserver.u2ug.org/mailman/listinfo/u2-users
> > >>
> > >> _______________________________________________
> > >> U2-Users mailing list
> > >> U2-Users@listserver.u2ug.org
> > >> http://listserver.u2ug.org/mailman/listinfo/u2-users
> > > _______________________________________________
> > > U2-Users mailing list
> > > U2-Users@listserver.u2ug.org
> > > http://listserver.u2ug.org/mailman/listinfo/u2-users
> > >
> > _______________________________________________
> > U2-Users mailing list
> > U2-Users@listserver.u2ug.org
> > http://listserver.u2ug.org/mailman/listinfo/u2-users
> >
> > _______________________________________________
> > U2-Users mailing list
> > U2-Users@listserver.u2ug.org
> > http://listserver.u2ug.org/mailman/listinfo/u2-users

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

Reply via email to