![](/img/trans.png)
[英]SQL Server: how to select records with specific date from datetime column
[英]How to query on DATE on DATETIME Column in SQL Server?
請提這個
SELECT * FROM myTable
WHERE completed_on BETWEEN 'date1' and 'Date2'
-- Pass Date Range in condition
另一種選擇是——
SELECT * FROM myTable
WHERE completed_on >= '20190701' --Sample start Date
and completed_on < '20190722'
-- This will make sure dates will be inclued less then
-- the given date. You have to pass this with
-- understanding what you want. If you want
-- date 7 to be included, please set the end date to 8
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.