Calculating weeks

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

Guest

I am trying to convert elapsed days into elapsed weeks, with any fraction of
a week, rounding up to the next highest week. In Excel, I use the MOD()
function to detemine if Days/Weeks is even or not, and if not, I add one to
the result. I don't see an equivalent function in Access. Am I missing
something?
 
I am trying to convert elapsed days into elapsed weeks, with any fraction of
a week, rounding up to the next highest week. In Excel, I use the MOD()
function to detemine if Days/Weeks is even or not, and if not, I add one to
the result. I don't see an equivalent function in Access. Am I missing
something?

Yup! Your missing the Mod operator (not function).

ElapsedWeeks = IIf([ElapsedDays] Mod 7
=0,int([ElapsedDays]/7),int([ElapsedDays]/7) +1)
 
CGSoniat said:
I am trying to convert elapsed days into elapsed weeks, with any fraction of
a week, rounding up to the next highest week. In Excel, I use the MOD()
function to detemine if Days/Weeks is even or not, and if not, I add one to
the result. I don't see an equivalent function in Access. Am I missing
something?


In VBA Mod is an operator, not a function.

weeks = days \ 7 + IIf((days Mod 7) > 0, 1, 0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top