We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用DateTime.Year进行查询,代码类似 where.And(x => x.PublishTime.Year == 2021);
where.And(x => x.PublishTime.Year == 2021);
在Sqlite数据库中,x.PublishTime.Year == 2021会转换成strftime('%Y',a."PublishTime") = 2021,前面为char类型,后面是int类型,无法查询到正确的数据。 如果使用 where.And(x => x.PublishTime.Year.ToString() == "2021"); 会转换为cast(strftime('%Y',a."PublishTime") as character) = '2021',也无法查询到正确数据。
x.PublishTime.Year == 2021
strftime('%Y',a."PublishTime") = 2021
where.And(x => x.PublishTime.Year.ToString() == "2021");
cast(strftime('%Y',a."PublishTime") as character) = '2021'
应该转换为strftime('%Y',a."PublishTime") = '2021',即前后都为char,在c#中表示应该类似为 where.And(x => x.PublishTime.Year == "2021"); 但是由于数据类型不一致,无法编译通过。
strftime('%Y',a."PublishTime") = '2021'
where.And(x => x.PublishTime.Year == "2021");
Sqlite
FreeSql.All 2.5.100
.Net5
The text was updated successfully, but these errors were encountered:
where.And(x => x.PublishTime.Year.ToString() == "2021"); 测试 没问题。
Sorry, something went wrong.
sqlite strftime('%m',a."CreateTime") 查出来的数据 是06 而不是 6 。
strftime('%m',a."CreateTime")
Millisecond 没有*1000,得到0 Ticks 精度有些问题。
所以这个时间处理上还是有问题。
var d3 = fsql.Select<Users>().ToList(r=>new { r.CreateTime, r.CreateTime.Date, r.CreateTime.TimeOfDay, r.CreateTime.DayOfWeek, r.CreateTime.Day, r.CreateTime.DayOfYear, r.CreateTime.Month, r.CreateTime.Year, r.CreateTime.Hour, r.CreateTime.Minute, r.CreateTime.Second, r.CreateTime.Millisecond, r.CreateTime.Ticks, });
#804 fix sqlite where datetime year,month 查不出来数据,Ticks 精度到毫秒,处理Millis…
b6ae46e
…econd无值的情况
v2.6.100 #843 #816 #815 #804 #803 #802
e0f9db7
No branches or pull requests
问题描述及重现步骤:
使用DateTime.Year进行查询,代码类似
where.And(x => x.PublishTime.Year == 2021);
在Sqlite数据库中,
x.PublishTime.Year == 2021
会转换成strftime('%Y',a."PublishTime") = 2021
,前面为char类型,后面是int类型,无法查询到正确的数据。如果使用
where.And(x => x.PublishTime.Year.ToString() == "2021");
会转换为
cast(strftime('%Y',a."PublishTime") as character) = '2021'
,也无法查询到正确数据。应该转换为
strftime('%Y',a."PublishTime") = '2021'
,即前后都为char,在c#中表示应该类似为where.And(x => x.PublishTime.Year == "2021");
但是由于数据类型不一致,无法编译通过。
数据库的具体版本
Sqlite
安装的包
FreeSql.All 2.5.100
.net framework/. net core? 及具体版本
.Net5
The text was updated successfully, but these errors were encountered: