[英]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.