1
Vote

Access、MySql及Sqlite中Today函数Bug

description

var item = db.Orders.Where(o => SqlFunctions.Now().Date == expected).FirstOrDefault();

在Access中生成的sql语句为:
SELECT TOP 1 t0.[OrderID], t0.[CustomerID], t0.[OrderDate]
FROM [Orders] AS t0
WHERE (Format(p0,'yyyy/mm/dd 0:00:00') = p1)
-- p0:(DbType = DateTime,Value = 2013/1/9 14:37:57)
-- p1:(DbType = DateTime,Value = 2013/1/9 0:00:00)

错误描述:在数据库选不出值来
可能问题:数据格式问题

comments