Results 1 to 5 of 5
  1. #1
    s-addicott is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    2

    Date queries

    i am trying to create a query that sorts arrival dates of bookings so that any customers booked in to arrive in the next week will appear.
    my intial thought would be <Date()+7 however this lists the customers that are to arrive within the next week aswell as any customers that have arrived in the past.


    my question is what would be an appropriate code to get all arrivals within the next week, but not arrivals that are in the past of the current date??

    thanks

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Maybe
    >= Date() And <Date()+7

    Or
    > Date() And <Date()+7
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    It sounds like you need to have the dates from today to 1 week from today. BTW, it would be better to use the dateadd() function to add the 7 days. The criteria would look like this


    WHERE yourdatefield BETWEEN date() and dateadd("d",7,date())

  4. #4
    s-addicott is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    2
    Quote Originally Posted by Bob Fitz View Post
    Maybe
    >= Date() And <Date()+7

    Or
    > Date() And <Date()+7
    YAY! works exactly how i needed it

    thanks alot

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Glad that worked for you, but I agree with jzwp11 that using DateAdd() function would be better
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Use same date to run two queries
    By 0REDSOX7 in forum Queries
    Replies: 1
    Last Post: 11-29-2011, 02:01 PM
  2. 2 Queries on one Date Field
    By LaPixie in forum Queries
    Replies: 1
    Last Post: 08-22-2011, 02:22 PM
  3. Count date entries from seperate tables/queries
    By krutoigoga in forum Queries
    Replies: 3
    Last Post: 06-30-2011, 12:48 PM
  4. Queries Criteria with date
    By dssrun in forum Queries
    Replies: 4
    Last Post: 04-21-2011, 12:50 PM
  5. Replies: 1
    Last Post: 07-07-2010, 04:22 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums