[AccessD] A2203: Date Format Issues

Jurgen Welz jwelz at hotmail.com
Fri Jul 18 11:54:46 CDT 2008


Thanks Gustav:  I just replaced my old 'LastDayOfMonth' function using the 'trick' I had not learned previously.CiaoJürgen WelzEdmonton, Albertajwelz at hotmail.com> Date: Fri, 18 Jul 2008 11:01:03 +0200> From: Gustav at cactus.dk> To: accessd at databaseadvisors.com> Subject: Re: [AccessD] A2203: Date Format Issues> > Hi Darryl> > This can be done a lot simpler. The trick is the day of zero which forces DateSerial to return the date before the first of the month.> > <code>> > Public Function DaysInMonth(ByVal datDate As Date) As Integer> > ' Returns count of days of month of datDate.> ' 2005-01-06. Cactus Data ApS, CPH.> > Dim intDays As Integer> > intDays = Day(DateSerial(Year(datDate), Month(datDate) + 1, 0))> DaysInMonth = intDays> > End Function> > </code>> > /gustav
_________________________________________________________________
Try Chicktionary, a game that tests how many words you can form from the letters given. Find this and more puzzles at Live Search Games!
http://g.msn.ca/ca55/207


More information about the AccessD mailing list