Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Location
    Moorpark, CA
    Posts
    104

    Cool Unanswered: Issues with Date Ranges

    Ok. This may seem like a dumb question to some of you people, but here goes... =)

    I would like access to use todays date and select all items that have the date between today's date and a certain amount of time from now, say 2 months. I tried using the date add function originally, but I'm not sure how to set up the actual statement to include dates between today and the date add date. Does that make any sense? Well nothing I tried worked, so if you can help, please do so! =)

    Thanks!

  2. #2
    Join Date
    Nov 2003
    Location
    Moorpark, CA
    Posts
    104

    Thanks

    Based on other questions people asked I figured out a way to do it. Thanks everyone. Just in case someone else runs in to such a problem this is what I did:

    [RenewalTBL].[ExpirationDate]>=Date() And [RenewalTBL].[ExpirationDate]<=DateAdd("m",2,Date())

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: Thanks

    Originally posted by Jennay
    Based on other questions people asked I figured out a way to do it. Thanks everyone. Just in case someone else runs in to such a problem this is what I did:

    [RenewalTBL].[ExpirationDate]>=Date() And [RenewalTBL].[ExpirationDate]<=DateAdd("m",2,Date())
    OR you can use BETWEEN


    [RenewalTBL].[ExpirationDate] BETWEEN Date() AND _
    DateAdd("m",2,Date())

  4. #4
    Join Date
    Nov 2003
    Location
    Moorpark, CA
    Posts
    104

    ....

    Actually I tried that exact thing and for some reason it doesn't work. Any ideas why?

  5. #5
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: ....

    Originally posted by Jennay
    Actually I tried that exact thing and for some reason it doesn't work. Any ideas why?
    Try something like that:
    SELECT urTable.join_id, urTable.name, urTable.vorname, urTable.eintrittsdatum

    FROM urTable
    WHERE (((urTable.eintrittsdatum) Between Date() And DATEADD("d",50,Date())));


    It functions by me.
    Good luck

Posting Permissions

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