Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从日期=特定日期的表中选择 *,但我的 sql 列是日期和时间格式。我如何在忽略时间的情况下检索特定日期的日期。
如果您使用的是 sql-server 2008 或更高版本,则可以使用convert函数转换datetime type 为 date type如下。
convert
datetime type
date type
select * from yourtable where convert(date, yourDateTimeCol) = yourDate