Days in month

From: Mitch (anonymous_at_discussions.microsoft.com)
Date: 04/23/04


Date: Fri, 23 Apr 2004 10:46:57 -0700

Thanks guys,
that works perfect !!!

>-----Original Message-----
>Not a built in, but the UDF is pretty simple:
>
>Function DaysInMonth(dteDay) As Integer
>Dim dteTemp As Date
>'Get the first day of the current month
>dteTemp = DateSerial(Year(dteDay), Month(dteDay), 1)
>'Add 1 month
>dteTemp = DateAdd("m", 1, dteTemp)
>'Subtract 1 day to get last day of previous month
>dteTemp = dteTemp - 1
>'Number of days in the month is the day part
>DaysInMonth = Day(dteTemp)
>End Function
>
>
>Call it like: DaysInMonth(Now)
>
>
>Chris Nebinger
>
>>-----Original Message-----
>>Hi all,
>> is there a function that will
>>give the number of days in a month that works with the
NOW
>>() function ? I have looked through help and I can't
see
>>anything obvious...
>>.
>>
>.
>



Relevant Pages

  • Days in month
    ... Not a built in, but the UDF is pretty simple: ... Dim dteTemp As Date ...
    (microsoft.public.access.gettingstarted)
  • Re: PostgreSQL and Firebird comparison via digg
    ... that kind of comments on Compiled External Function (UDF) Support about firebird: ... 'Yes Currently used to get around lack of built in functions.' ...
    (borland.public.delphi.non-technical)
  • Re: PostgreSQL and Firebird comparison via digg
    ... "A User Defined Function (UDF) is a mechanism provided to extend the built-in functions InterBase provide. ... Some common functions that are missing are modulo arithmetic, floating point formatting routines, date manipulation routines and string manipulation routines." ... It's a generally know fact that in order to get access to functions most other databases have built in, you HAVE to resort to UDFs to get that functionality. ... Now in Firebird 2.1 beta they have added some more built in functions, but 2.1 is not a production release yet and can't be used in any comparison. ...
    (borland.public.delphi.non-technical)
  • Re: countif based on fill color
    ... Not possible with built in functions unless you can use the criteria which made you colour them in the first place, otherwise you will need code, either a macro or a UDF ... count all cells I've filled in red. ...
    (microsoft.public.excel.worksheet.functions)
  • Conditional Sumproduct
    ... I have already written a UDF for another calculation in this workbook, so I can do that here, but I would rather use the built in functions in I can. ...
    (microsoft.public.excel.worksheet.functions)