Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Passed 4 weeks (2003)

    I have a date field called Started and want to know (precisely) if four weeks have passed since then to today's date. Is the DateDiff function accurate enough to achieve this? For example, I can't use DateDiff to find someone's age because it counts the number of years that have passed, rather than the number of whole years between. Thanks, Andy.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Passed 4 weeks (2003)

    You can simply detract Started from today's date:

    Date()-[Started]

    Since 1 day is the unit used by Access when storing date/time values, the difference between two dates is the number of days between them. So in your case, you'd be looking for a difference of 28 days.

    Alternatively, you can use DateDiff("d", [Started], Date())

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passed 4 weeks (2003)

    Thank you. Of course it's just 28 days?! How can I check if a year has expired? If I use DATEDIFF with "yyyy" it will tell me that for two dates - one in 2007 and the other in 2008 - one year has expired even though I know that less that one year has elapsed? Thanks, Andy.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Passed 4 weeks (2003)

    See the thread starting at <post:=561,615>post 561,615</post:> for some possible solutions.

  5. #5
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passed 4 weeks (2003)

    Thank you. I believe the link includes what I have been looking for all these years (excusing the pun?!). Andy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •