DateDiff result to be rounded

C

CW

I am using DateDiff with "w" to produce the result in weeks, which is then
used as the chargeable period for the storage of goods.
We charge "per week or part", therefore I would like the result to be
rounded up.
My expression looks like this at the moment:
=DateDiff("w",[FromDate],[ToDate])
How should I modify this to get a rounded-up figure, please?
Many thanks
CW
(P.S. my first post of 2009 so many many thanks and a Very Happy New Year to
all you good people who provide such invaluable assistance here!)
 
K

Ken Sheridan

Try this:

=DateDiff("w",[FromDate], [ToDate]) + IIf(DateDiff("d",[FromDate], [ToDate])
Mod 7 > 0,1,0)

Ken Sheridan
Stafford, England
 
C

CW

Thanks, Ken
CW

Ken Sheridan said:
Try this:

=DateDiff("w",[FromDate], [ToDate]) + IIf(DateDiff("d",[FromDate], [ToDate])
Mod 7 > 0,1,0)

Ken Sheridan
Stafford, England

CW said:
I am using DateDiff with "w" to produce the result in weeks, which is then
used as the chargeable period for the storage of goods.
We charge "per week or part", therefore I would like the result to be
rounded up.
My expression looks like this at the moment:
=DateDiff("w",[FromDate],[ToDate])
How should I modify this to get a rounded-up figure, please?
Many thanks
CW
(P.S. my first post of 2009 so many many thanks and a Very Happy New Year to
all you good people who provide such invaluable assistance here!)
 

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

Top