使用 SubSonic 获取不同的月份和年份
我有日期类型列(MySQL):
SELECT invdate FROM invoices;
invdate
-------
2009-08-22
2009-07-12
2009-08-23
-------
我想要像这样获取月份和年份:
SELECT DISTINCT MONTH(invdate) AS invmonth, YEAR(invdate) AS invyear FROM invoices;
如何在 C# 中使用 SubSonic (SimpleRepository)?
TIA
I have date type column (MySQL):
SELECT invdate FROM invoices;
invdate
-------
2009-08-22
2009-07-12
2009-08-23
-------
and I want get month and year like this:
SELECT DISTINCT MONTH(invdate) AS invmonth, YEAR(invdate) AS invyear FROM invoices;
how to use in C# with SubSonic (SimpleRepository)?
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您有机会查看文档吗?请参阅下面的链接和代码,它应该有所帮助。
http://subsonicproject.com/docs/Distinct
Have you had a chance to have a look at the docs? See the link and code below, it should help.
http://subsonicproject.com/docs/Distinct
我的天啊!我忘记将变量定义为日期/日期时间,所以我无法使用这些函数。
之前:
之后:
我的错误,对不起。 问题已解决。
OMG! I forgot to define variable as date/datetime, so I can not use these functions.
before:
after:
My mistake, I'm sorry. Problem solved.