Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Posts
    1

    Unanswered: Form criteria based on an entered date and date today

    Hi

    I am very new to SQL so please excuse me if my question seems too easy to answer.

    Basically I need to populate a form based with records based on the criteria that the next mot date and todays are +/- 10 days.

    i.e if todays date is 13/05/07 and the next mot date is 3/05/07 or later OR 23/05/07 or less then various fields will be shown in the form.

    Can you please help.

    Thanks
    Paul

  2. #2
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    Sounds like DATEADD is the ticket. Why don't you look it up in BooksOnline, try crafting a query, and come back with your query and results.

    Also, you might want to include schema information of the table you are trying to extract data from.

    -- This is all just a Figment of my Imagination --

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    SELECT * FROM TABLE
    WHERE DATEDIFF(d,10,[dateColumn] > GetDate()
    OR DATEDIFF(d,-10,[dateColumn] < GetDate()
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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