Results 1 to 3 of 3
  1. #1
    Ushera is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2009
    Posts
    5

    HELP!!next date query, 7 days from the present date

    hello,
    I tried to run this query without succeess:

    SELECT Interns, Companies, startdate, Enddate


    FROM Table1
    WHERE Enddate=DateAdd("d",7,date(2009-7-31))

    I want to retrieve the end dates of the interns before the end date actually reaches, that is 7 days before. I used this this query but i get an error message.
    Is sth wrong with it? Please help!!

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    I think you have messed up the dateadd part. If you want to show records with end dates that are 7 or less days from 2009-7-31 you need this:

    >= DateAdd("d",-7,#2009-7-31#)

    You need to make sure that the EndDate format is the same as the one in the DateAdd function.

    If this is not what you need please let me know with an explanation of what you do need.

  3. #3
    Ushera is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2009
    Posts
    5

    Smile

    Thank you "software matters" !!
    it worked

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

Similar Threads

  1. Compare date in a sql query
    By access in forum Forms
    Replies: 2
    Last Post: 06-17-2009, 12:57 PM
  2. 90 days in the pass - Date help wanted
    By techexpressinc in forum Queries
    Replies: 1
    Last Post: 01-26-2009, 07:13 AM
  3. Query (Date Question)
    By cillajones in forum Queries
    Replies: 1
    Last Post: 08-09-2008, 12:05 PM
  4. Need to set date in query for automation
    By Valeda in forum Queries
    Replies: 0
    Last Post: 06-07-2006, 06:41 AM
  5. Replies: 1
    Last Post: 12-09-2005, 10:29 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