Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 function for determining number of days in month

Author  Topic 

kaus
Posting Yak Master

179 Posts

Posted - 2003-01-24 : 13:56:36
is there a function in access for returning the number of days in a month ??

Thnxs

Pete

kaus
Posting Yak Master

179 Posts

Posted - 2003-01-24 : 14:03:03
this works as long as I use first of month
SELECT DateDiff("d",#2/1/2002#,DateAdd("m",1,#2/1/2002#)) AS Expr1;



Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2003-01-27 : 07:38:32
HOw about:

public function DaysInMonth(Yr as integer, Mnth as integer) as integer
DaysInMonth = Day(DateSerial(Yr,Mnth+1,1)-1)
End Function

- Jeff
Go to Top of Page
   

- Advertisement -