Dates

patricespencer

New member
Local time
Today, 00:50
Joined
Jun 22, 2001
Messages
6
I hope someone can help me. I need to calculate a Normal Retirement Date. That is the date that you are 65.

Also, when calculating this date if you are born <=16 of the month then the date needs to be the first of that month (ex. dob=7/12/57 the NRD would be 7/1/2022) and if you are born after the 16th of the month, the date needs to be the 1st of the next month (ex. dob=7/23/57 the NRD would be 8/1/2022).

Does anyone have any ideas how I can do this?

Thanks.
 
Sure use this function...

Public Function GetNRD(DOB As Date) As Date
Dim TempDate As Date

TempDate = DateAdd("yyyy", 65, DOB)
If Day(DOB) <= 16 Then
GetNRD = CDate(Month(DOB) & "/1/" & Year(TempDate))
Else
GetNRD = CDate((Month(DOB) + 1) & "/1/" & Year(TempDate))
End If

End Function

Hope that helps.

Doug
 
Thanks for the quick answer. Now I have another question...how will this handle Dec/Jan. If the employee was born 12/23/1957 then his NRD will be 01/01/2023. Will this fuction handle something like this.

Also, I am very new to programming in Access, where do I put this function.

Thanks for all your help.
 
I'd like to get some followup on this issue as well. The DEC/JAN issue here, seems to me, would be a problem.

My client uses strictly the first of the month FOLLOWING the 65th birthday.

Help?
 
Anyone? Anyone? This answer would be a HUGE help to me right now. THANKS!!
 
Does no one have any answer to this for me?

Thanks for ANY help of writing this calculation!

Tom
 
Pat and D-Fresh. et al:

I think I understand where we're headed here... but I don't understand GetNRD.

If I simply want the first of the month following the 65th birthday, would it be:

Public Function GetNRD(DOB As Date) As Date
Dim TempDate As Date

TempDate = DateAdd("yyyy", 65, DOB)
GetNRD = CDate(DateAdd("m",1,TempDate) & "/1/" & Year(DateAdd("m",1,TempDate)))
End If

End Function


???

Thanks! Tom
 
OK... I am just not getting this.

I have a field called "birthdate" and am trying to create one called "Normal Retirement Date" with the formula. I am not sure how to create the field using the code or how to name the field to be updated.

I am still hung up, I think, on Excel formula syntax conventions and I just am not getting this. If someone could give me the play-by-play on doing this, I would be GREATLY indebted!!

Thanks!!!
Tom
 
I am still struggling with this. Thanks for any who can clear this up for me.

Tom
 
Pat:

I am obviously missing something significant here. I do not have a query related to this. All I have is a form field called "Birthdate" and a form field in which I want to calculate the retirement date, which is to be called "Normal Retirement Date." The date should be the first of the month following the 65th birthday.

I don't understand what "GetNRD(DOB)" is. Also, I did put the code in a module but the field just stays blank. I apologize... I understand a little VBA, but this is beyond me.

Tom
 
OK... I would like to use VBA code, but I have little understanding. I found the DateSerial function, and put the following in an unbound text box:

=DateSerial(Year([Birthdate])+65,Month([BirthDate])+1,1)

It works.

Tom
 
Last edited:

Users who are viewing this thread

Back
Top Bottom