Re: Last day of month..
Posted in 1998
ummm, try... MDY(MONTH(in_date), 1, YEAR(in_date)) + 1 UNITS MONTH - 1 UNITS DAY; returns a date value of the last day of the month for the month of "in_date". Sunil Thakkar <sunil0@hotmail.com> wrote in article <6u654h$qa0$1@news.xmission.com>... > > Last day of the month. > > Check for the correct syntex but the logic works: > > Function last_day_m(month, year) returning date; > > let dd = 28 > let xdate = dd + mm + yyyy > whenever error continue ; > for i = 1 to 3 > dd = dd + 1 ; > xdate = dd + mm + yyyy ; > if xdate is invalid > exit for > end if > next i > dd = dd + 1 > xdate = dd + mm + yyyy > > return xdate > > end function; > > Thanks, > Sunil. > > > > ----Original Message Follows---- > Subject: Re: Last day of month.. > To: mdstock@informix.com > Date: Mon, 21 Sep 1998 17:39:41 +0300 (EETDST) > From: Octav Chiriac <com@netinfo-moldova.com> > Cc: informix-list@iiug.org > Reply-to: com@netinfo-moldova.com > > Mark D. Stock wrote: > >SUNIL S. SINGH wrote: > >> > >> Hi All !! > >> > >> Is there any function or technique to find last day of month > >> ie 29 or 28 or 30 or 31 for a particular date(dd/mm/yy) > > > >Try: > > > >SELECT DAY(MDY(MONTH(TODAY)+1,1,YEAR(TODAY))-1) > >FROM systables > >WHERE tabid = 1 > > > > OOPS, WRONG, WRONG !!!! > > What is the result for december dates ? > > @informix.com ??? To :-) OR :-( ??? > > Bye, > Octav > > >|Mark D. Stock - Informix SA http://www.informix.com |//////// > /| > >|mailto:mdstock@informix.com http://www.informix.com/idn |///// / > //| > >|http://www.iiug.org +-----------------------------------+//// / > ///| > >| Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / > ////| > >| Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / > /////| > >|Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ > ////////| > >+----------------------+-----------------------------------+-----------+ > > -- > Octav Chiriac Phone: (373) 2 21 20 96 > NetInfo S.R.L. Fax: (373) 2 21 20 96 > Chisinau (373) 2 24 00 83 > Moldova, Republic of mailto:com@netinfo-moldova.com > > > > ______________________________________________________ > Get Your Private, Free Email at http://www.hotmail.com >