日期函数 里面 按周查询怎么样实现 #1471
Replies: 2 comments
-
自定义解析[ExpressionCall]
public static class Sql {
static ThreadLocal<ExpressionCallContext> context = new ThreadLocal<ExpressionCallContext>();
public static DateTime FormatDateTime(this DateTime that, string arg1)
{
var up = context.Value;
up.Result = $"date_format({up.ParsedContent["that"]}, {up.ParsedContent["arg1"]})";
return that;
}
}
var sql1 = fsql.Select<SysModule>().ToSql(a => a.CreateTime.FormatDateTime("yyyy-MM-dd"));
//SELECT date_format(a."CreateTime", 'yyyy-MM-dd') as1
//FROM "SysModule" a |
Beta Was this translation helpful? Give feedback.
0 replies
-
好的,谢谢 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
sqlserver SQL是这样写的
and DATEPART (WW, FIQCDATE)=DATEPART(WW,'" + strFromTime + "') and DATEPART (YEAR,FIQCDATE)=DATEPART (YEAR,'" + strFromTime + "')
Beta Was this translation helpful? Give feedback.
All reactions