分组月和年度明智 [英] Grouping Month & Year wise

查看:68
本文介绍了分组月和年度明智的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据月份和时间对值进行分组。明智的



这是我的查询

I want to Group the values based upon month & year wise

this is my query

SELECT Proj_code,Material_TYPE,DED_Description,DED_Short_Desc,Planned_date,Planned_Material_Qty,   Planned_Cumulative,Prev_Month_Planned,Current_Month_Planned,Release_Date,Material_Quantity,Actual_Cumulative, Prev_month_Actual,CumulativeProgress_Planned,CumulativeProgress_Actual 
FROM    @FINAL



MY OUTPUT看起来像






MY OUTPUT looks like


ID      DATE1         DATE2       Qty
1       2013-02-23    2013-02-12  100 
1       2013-02-23    2013-02-01  200



但我想在月份和数量上一年明智...



如何实现这个


But i want Qty in month & year wise...

How to achieve this

推荐答案

参考下面的解决方案....希望它会对你有所帮助。

sql-query-to-get-month-wise-data-year.html [ ^ ]
refer below solution.... hope it will helpful for you.
sql-query-to-get-month-wise-data-year.html[^]






您为此尝试了哪些代码?检查以下链接还



如何获取表格中字段的累计总和 [ ^ ]

如何获得累计金额 [ ^ ]

如何在表中找到累积和 [ ^ ]

Sql Server中的累积总和 [ ^ ]

问候,

GVPrabu
Hi,

What code you tried for this...? Check the following Links also

How can I get the cumulative sum of a field in a table[^]
how to get cumulative sum[^]
How to find Cumulative Sum in a Table [^]
Cumulative sum in Sql Server[^]
Regards,
GVPrabu


在查询中包含以下内容

Include the below in your query
GRUP BY MONTH(YOUR_DATE_TIME_COLUMN) AND YEAR(YOUR_DATE_TIME_COLUMN)


这篇关于分组月和年度明智的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆