Next occurrence of day of month

  • Thread starter Thread starter RT_Indy
  • Start date Start date
R

RT_Indy

I am trying to come up with a formula that returns the date of the next
occurrence of the 15th of the month. For example, if today is 04/02/09, I
want the formula to return 04/15/09. If today were 04/22/09, I want the
formula to return 5/15/09 and so on. This seems like it should be simple but
I can't quite figure out how to get there and I haven't found the solution on
this board.

If it makes a difference, I am using Access 2003. Thanks in advance for the
assistance.
 
Use the DateSerial function;

DateSerial(Year(Date()),IIf(Day(Date())<16,Month(Date()),Month(Date())+1),15)

You can moify the argument in the IIf statement depending on what
you want to happen if today is the 15th (do you want it to show today
or next month?).
 
If today is the 15th, I want to show today, which I did by modifying the
"<16" in what you sent to be <=15. It appears to work perfectly.

Thanks a lot for your help.

RT_Indy
 
Back
Top