0
   Select * From MyTable where Email_Date = @Email_Date

    --Email_Date = 2012-05-13 10:49:48.050

SQL Server 2008 R2。Email_Date 是日期时间字段。不返回任何记录。如何将日期时间作为过滤器传递。

4

1 回答 1

0
DECLARE @Email_Date_Str varchar(10)
SET @Email_Date_Str = CONVERT(varchar(10), @Email_Date, 120)
SELECT * FROM MyTable WHERE CONVERT(varchar(10), Email_Date, 120) = @Email_Date_Str
于 2012-05-14T04:08:22.740 回答