I have this var mydate 03/08/2014 (as date dimnensioed) i need based this date, to get the first and last day of this month?
In my case august/2014
GET FIRST AND LAST DAY BASED A DATE
-
- PlatinumLounger
- Posts: 4353
- Joined: 26 Apr 2010, 17:36
-
- Administrator
- Posts: 78446
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: GET FIRST AND LAST DAY BASED A DATE
First day of month: DateSerial(Year(MyDate), Month(MyDate), 1)
Last day of month: DateSerial(Year(MyDate), Month(MyDate) + 1, 0)
Last day of month: DateSerial(Year(MyDate), Month(MyDate) + 1, 0)
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4353
- Joined: 26 Apr 2010, 17:36
Re: GET FIRST AND LAST DAY BASED A DATE
HansV wrote:First day of month: DateSerial(Year(MyDate), Month(MyDate), 1)
Last day of month: DateSerial(Year(MyDate), Month(MyDate) + 1, 0)
perfect!
But this code consider the particular month "febrary"? i think yes
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: GET FIRST AND LAST DAY BASED A DATE
Yep...even leap years will result in day 29.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.