mohamed aqeel
New member
- Local time
- Today, 02:57
- Joined
- Jan 25, 2012
- Messages
- 7
Hi,
In my database I need to find the Experience of an employee based on his DOJ. So I have used a formula
Round((((Year(Date) - Year([DOJ])) * 365 + (Month(Date) - Month([DOJ]) * 30.4 + Day(Date) - Day([DOJ])) / 365),1)
in the control source property of my field Exp.and it worked well, i got the experience with the fraction part.But I was unable to store that value in Tables.So I modified the code little and inserted in the After Update event of the DOJ field.
the code is,
Private Sub DOJ_AfterUpdate()
Me.EXP = Round((((Year(Date) - Year(Me.DOJ)) * 365 + (Month(Date) - Month(Me.DOJ)) * 30.4 + Day(Date) - Day(Me.DOJ)) / 365), 1)
End Sub
but now i am not getting the fractional part.I am getting the experience value as a whole number only.
Eg:
DOJ = 11-May-88
EXP = 24
Please help me to solve this issue.
THANKS IN ADVANCE!!!
In my database I need to find the Experience of an employee based on his DOJ. So I have used a formula
Round((((Year(Date) - Year([DOJ])) * 365 + (Month(Date) - Month([DOJ]) * 30.4 + Day(Date) - Day([DOJ])) / 365),1)
in the control source property of my field Exp.and it worked well, i got the experience with the fraction part.But I was unable to store that value in Tables.So I modified the code little and inserted in the After Update event of the DOJ field.
the code is,
Private Sub DOJ_AfterUpdate()
Me.EXP = Round((((Year(Date) - Year(Me.DOJ)) * 365 + (Month(Date) - Month(Me.DOJ)) * 30.4 + Day(Date) - Day(Me.DOJ)) / 365), 1)
End Sub
but now i am not getting the fractional part.I am getting the experience value as a whole number only.
Eg:
DOJ = 11-May-88
EXP = 24
Please help me to solve this issue.
THANKS IN ADVANCE!!!