Here, I changed this:

//If the result is greater than days in month or less than 1, return -1
  if(TheDayInMonth gt DaysInMonth(CreateDate(TheYear,TheMonth,1)) OR
TheDayInMonth lt 1){
    return -1;
  }
  else{
    return TheDayInMonth;


to this:

//If the result is greater than days in month or less than 1, return -1
  if(TheDayInMonth gt DaysInMonth(CreateDate(TheYear,TheMonth,1)) OR
TheDayInMonth lt 1){
    return TheDayInMonth - 7;
  }
  else{
    return TheDayInMonth;

So far, seems to fix it.

H.


> -----Original Message-----
> From: Owens, Howard [SMTP:[EMAIL PROTECTED]
> Sent: Saturday, March 01, 2003 6:50 PM
> To:   CF-Talk
> Subject:      RE: anybody ever done: every n day of the month for a year
> ... 
> 
> Oops, found a problem with this UDF ...
> 
> It give you the option of feeding in a 5 for the Nth recurrence, which 5,
> as
> I take it, should equal 'last' ... meaning, say, the Last Friday of the
> month.  Some months that will be the 5th Friday, some months the 4th.
> 
> So for November, for example, the UDF returns -1 instead of the 28th.
> 
> H.
> 
> 
> > -----Original Message-----
> > From:       Cameron Childress [SMTP:[EMAIL PROTECTED]
> > Sent:       Saturday, March 01, 2003 11:28 AM
> > To: CF-Talk
> > Subject:    RE: anybody ever done: every n day of the month for a year
> > ... 
> > 
> > Always check CFLib first...
> > 
> > http://www.cflib.org/udf.cfm?ID=179
> > 
> > -Cameron
> > 
> >                             
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to