Linq 生成的sql代码中的Sqlite和strftime格式字符串
我必须查询表中的日期时间间隔。假设我有以下4行:Linq 生成的sql代码中的Sqlite和strftime格式字符串,linq,sqlite,system.data.sqlite,Linq,Sqlite,System.data.sqlite,我必须查询表中的日期时间间隔。假设我有以下4行: id typeId start end 1 11 18.09.2014 18.09.2014 23:45:00 2 11 19.09.2014 19.09.2014 23:45:00 3 12 18.09.2014 18.09.2014 23:45:00 4 12 19.09.2014 19.09.2014 23:45:00 Linq查询如下
id typeId start end
1 11 18.09.2014 18.09.2014 23:45:00
2 11 19.09.2014 19.09.2014 23:45:00
3 12 18.09.2014 18.09.2014 23:45:00
4 12 19.09.2014 19.09.2014 23:45:00
Linq查询如下:
model.Entities.Wheret=>t.StartTime>=start&&t.EndTime我找到了答案,可以为strftime函数的两个操作数提供额外的sql语句和正确的用法
//some omitted sql select from
where a.[StartTime] >= strftime('%Y-%m-%d %H:%M:%f', @p2)
AND
a.[EndTime] <= strftime('%Y-%m-%d %H:%M:%f', @p3)