Unix Technical Forum

Re: Using I4GL to determine payperiods.... new report processor?

This is a discussion on Re: Using I4GL to determine payperiods.... new report processor? within the Informix forums, part of the Database Server Software category; --> Gorazd Hribar Rajterič wrote: > [snip] > >>MDY(MONTH(TODAY + 1 UNITS MONTH),1,YEAR(TODAY))-1 >> > > [snip] > > Using ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 08:15 PM
Mark D. Stock
 
Posts: n/a
Default Re: Using I4GL to determine payperiods.... new report processor?


Gorazd Hribar Rajterič wrote:

> [snip]
>
>>MDY(MONTH(TODAY + 1 UNITS MONTH),1,YEAR(TODAY))-1
>>

>
> [snip]
>
> Using TODAY + 1 UNITS MONTH will fail if today is 31st day of the month and
> next month only has 30 days. The same happens on january 29th (if it's not a
> leap year), 30th and 31st.


You are quite right! That will teach me to cut&paste so hastily from 4GL
into SQL. So I guess the full syntax should be something like:

MDY (
MONTH(MDY(MONTH(TODAY), 1, YEAR(TODAY)) + 1 UNITS MONTH),
1,
YEAR(MDY(MONTH(TODAY), 1, YEAR(TODAY)) + 1 UNITS MONTH)
)-1

Cheers,
--
Mark.

+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@MydasSolutions.com |//////// /|
| Mydas Solutions Ltd http://MydasSolutions.com |///// / //|
| +-----------------------------------+//// / ///|
| |We value your comments, which have |/// / ////|
| |been recorded and automatically |// / /////|
| |emailed back to us for our records.|/ ////////|
+----------------------+-----------------------------------+-----------+

sending to informix-list
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:40 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com