当前位置: 动力学知识库 > 问答 > 编程问答 >

sql - Find any of days is fall under list of dates

问题描述:

This question already has an answer here:

  • How can I determine in SQL Server if a dateTime range overlaps another

    1 answer

网友答案:
SELECT
  *
FROM
  yourTable
WHERE
      to_date   >= @from_date_parameter
  AND from_date <= @to_date_parameter
网友答案:
SELECT ID FROM MyTable
WHERE FromDate<= '2012/02/03' AND ToDate>= '2012/01/25'

See this SQLFiddle

分享给朋友:
您可能感兴趣的文章:
随机阅读: