Results 1 to 5 of 5
  1. #1
    rstonehouse is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Location
    UK
    Posts
    5

    Select Dates between days and two days ago?

    Hi all,



    I'm really new to Access (just started today) and am building a query from an imported sheet. In one of the columns (which is date formatted) I'm trying to get only the ones with the date from two days ago to today.

    In the criteria box of the column i put

    Between DatePart("d",Date()-2) And Date()

    I know this is probably completely wrong but if anyone could help then that would be great

    Thanks!

    Rob

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Look into the DateAdd() function.

  3. #3
    rstonehouse is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Location
    UK
    Posts
    5
    Hey thanks,

    I looked up the date add function and replaced what I had with

    DateAdd ("d", -2, Now() )

    and this too came with no results.

    Sorry if I'm being stupid

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Now() returns both a date and a time. Better to use Date() for this exercise.

  5. #5
    rstonehouse is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Location
    UK
    Posts
    5
    thanks, turns out my expression was well out but your help pointed me in the right direction!

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

Similar Threads

  1. Help with SQL: Birthdays in Next 30 days
    By kaylachris in forum Queries
    Replies: 1
    Last Post: 06-21-2010, 05:24 PM
  2. Travel days.
    By emccalment in forum Access
    Replies: 1
    Last Post: 01-06-2010, 05:39 PM
  3. Replies: 4
    Last Post: 08-27-2009, 01:21 AM
  4. less than 180 days old
    By techexpressinc in forum Queries
    Replies: 2
    Last Post: 06-04-2009, 04:29 PM
  5. Total no of days in a month
    By wasim_sono in forum Forms
    Replies: 4
    Last Post: 10-15-2006, 01:05 PM

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