LastDay Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to know the number of days after a loan has funded between the fund
date and the end of the month.

LastDayOfMonth - FundDate

Is there a Last Day of the month Date?
 
Hi Jose

You can use the DateSerial(year, month,day) function:

LastDayOfMonth = DateSerial( Year([Somedate]), Month([Somedate])+1, 0 )

The trick is to consider the last day of the month to be the *zeroth* day of
the next month.
 
You can use this --
DateAdd("m",1,Date()-Day(Date()))

Day(Date() -- gives day of month
Date()-Day(Date()) -- substracts the day of the month from the current date
which is the last day of last month
DateAdd("m",1,Date()-Day(Date())) -- adds 1 month to last day of last month.
 
Hi Karl/Jose

This method won't work if the previous month has fewer than 31 days.

For example, if the date is 5 March, then Date()-Day(Date()) will be 28
February. Add one month and you get 28 March, not 31 March.
 
Back
Top