dateDiff help

N

Neal Ostrander

I have a query that uses the dateDiff function to calculate the number of
weeks between dates. The problem I am having is if the dates are less than a
week apart how can I get the query to update my text field to 1.
Thanks in advance.
 
N

Neal Ostrander

Thanks,
I will give that a try.

Allen Browne said:
So you want any fraction of a week to be counted as a week?
So 1 day or 7 days would be 1 week; 8 - 14 days would be 2 weeks, etc.

Try:
- Int(DateDiff("d", [EndDate], [StartDate]) / 7)

Explanation of how it works:
http://allenbrowne.com/round.html#RoundUp

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

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

Neal Ostrander said:
I have a query that uses the dateDiff function to calculate the number of
weeks between dates. The problem I am having is if the dates are less than
a
week apart how can I get the query to update my text field to 1.
Thanks in advance.
 

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