How do I write a SQL query for a specific date range and date time using SQL Server 2008?

前端 未结 8 434
刺人心
刺人心 2021-01-04 01:33

I need to write a query that will get all the rows in a specified date range and time range.

For example, I want to query all the rows from 5:00PM on 16-Sep-2010 to

8条回答
  •  囚心锁ツ
    2021-01-04 01:55

    You can try this:

    SELECT * FROM MYTABLE WHERE DATE BETWEEN '03/10/2014 06:25:00' and '03/12/2010 6:25:00'
    

提交回复
热议问题