DateDiff result to be rounded

  • Thread starter Thread starter CW
  • Start date Start date
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!)
 
Try this:

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

Ken Sheridan
Stafford, England
 
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!)
 
Back
Top