Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How do I create a query that finds dates within a specific range?

I was wondering if it is possible to create a query to find dates that are within a few days/weeks? Would it be possible to create a query like this but be similar to a query that finds duplicates(this one finding close dates instead of duplicates)? I need this to create some statistics of variation between dates and don't want to have to search through thousands of records to find close dates that have one other field in common.

Update:

I would also like to add that it would be nice if I didn't have to give a specific date range but could create my query to find dates that were only a few days apart since they may occur in different months. So what I am really looking for is not dates from 5-15-xxxx to 5-20-xxxx but any date entries that are within 5 days apart from one another. Is that even possible?

2 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    yes. the syntax will vary slightly depending on what database your are using. but, the general idea is:

    select *

    from tablename

    where datefieldname>='2008-05-01' and datefieldname<='2008-05-31'

  • 1 decade ago

    create a variable type "date"

    and in your do a IF statement

    °°°°°°°°°°°°°°°°°°°°°°

    lke if date => ****

    else

    x =< *****

    °°°°°°°°°°°°°°°°°°°°

Still have questions? Get your answers by asking now.