formula

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

Guest

Hi all,

I would appreciate if you help me out on this case here. I am having problem
in calculating 30 days calculation here. An employe is entitled to take one
sick day each 30 days. For example by today he rates 11 sick days starting
the day he is hired by the company. The hired date is 12/20/2004 and today is
11/30/2005. I put the formula MONTHS: "(Now()-[CONTRACT DATE])/30". It is
giving me 11.5. How can i make it to give 11? I tried to round it and it came
up with 12, well it is obvious. Please advice.

Al
 
Int() will drop the fractional part:

Int(DateDiff("d", [CONTRACT DATE], Date()) /30)
 
Thanks Allen, that's what I wanted. Appreciate your help.

Al

Allen Browne said:
Int() will drop the fractional part:

Int(DateDiff("d", [CONTRACT DATE], Date()) /30)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

alish said:
I would appreciate if you help me out on this case here. I am having
problem
in calculating 30 days calculation here. An employe is entitled to take
one
sick day each 30 days. For example by today he rates 11 sick days starting
the day he is hired by the company. The hired date is 12/20/2004 and today
is
11/30/2005. I put the formula MONTHS: "(Now()-[CONTRACT DATE])/30". It is
giving me 11.5. How can i make it to give 11? I tried to round it and it
came
up with 12, well it is obvious. Please advice.

Al
 
Back
Top