Browse Source

Update sqlite date expression

pull/10/MERGE
sunkaixuna 3 years ago
parent
commit
131108e282
  1. 4
      Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs

4
Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs

@ -882,6 +882,10 @@ namespace SqlSugar
{
return $"to_char({value},'{formatString}') ";
}
else if (IsSqlite() && formatString == "yyyy-MM-dd")
{
return $"strftime('%Y-%m-%d', {value})";
}
else if (IsMySql() && formatString == "yyyy-MM-dd")
{
return $"DATE_FORMAT({value}, '%Y-%m-%d')";

Loading…
Cancel
Save