Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
leandro_logus asked how to get the last day of a month in Informix. Kernoal pointed to a June Hunt dates presentation from the Tampa 2006 conference. Richard Harnden and mehdi2 gave the approach: build a date with MDY for the first day of the following month and subtract one day. Eric posted a reply whose content was not shown.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Hi, I'm have a problem, I would like know how return a last day of the
month in db Informix .
Thank you.
leandro@logus-consultoria.com.br.
--
leandro_logus
------------------------------------------------------------------------
leandro_logus's Profile: http://www.dbtalk.net/m544
View this thread: http://www.dbtalk.net/t319978
At the Tampa conference 2006, June Hunt did a session on dates with
Informix.
Very good presentation! It can be found @ www.iiug.org.
FYI
leandro_logus wrote:
> Hi, I'm have a problem, I would like know how return a last day of the
> month in db Informix .
>
> Thank you.
> leandro@logus-consultoria.com.br.
>
>
> --
> leandro_logus
> ------------------------------------------------------------------------
> leandro_logus's Profile: http://www.dbtalk.net/m544
> View this thread: http://www.dbtalk.net/t319978
leandro_logus wrote:
> Hi, I'm have a problem, I would like know how return a last day of the
> month in db Informix .
>
Make a date, using MDY, as the first day of the next month and take one
away.
--
rh
> leandro_logus wrote:
> > Hi, I'm have a problem, I would like know how return a last day of the
> > month in db Informix .
> >
Try this
-----------------------------------------------------------------------------------------
create procedure lastDayOfMonth(dt date) returning date; return extend(extend(dt+1 units month,year to month)||"-01"
,year to day) - 1 units day;
end procedure;
execute procedure lastDayOfMonth(today);-----------------------------------------------------------------------------------------
Eric Lam
eric.lam@cobrasonic.com
Hi Leandro;
Consider, the last day of a month is the the first day of the following month - 1 day.
On 18 Jul 2006 at 12:54, leandro_logus wrote:
>
> Hi, Im have a problem, I would like know how return a last day of the
> month in db Informix .
>
> Thank you.
> leandro@logus-consultoria.com.br.
>
>
> --
> leandro_logus
> ------------------------------------------------------------------------
> leandro_logus's Profile: http://www.dbtalk.net/m544
> View this thread: http://www.dbtalk.net/t319978
>
>
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.