How do I query for all dates greater than a certain date in SQL Server?

后端 未结 5 1047
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-27 09:18

I\'m trying:

SELECT * 
FROM dbo.March2010 A
WHERE A.Date >= 2010-04-01;

A.Date looks like: 2010-03-04 00:00:00.000

5条回答
  •  死守一世寂寞
    2020-11-27 09:55

    To sum it all up, the correct answer is :

    select * from db where Date >= '20100401'  (Format of date yyyymmdd)
    

    This will avoid any problem with other language systems and will use the index.

提交回复
热议问题