Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
T-SQL (SS2K5)
»
Get Monthly total in sp
Get Monthly total in sp
Rate Topic
Display Mode
Topic Options
Author
Message
ruwanwickrama
ruwanwickrama
Posted Thursday, December 16, 2010 11:38 PM
Forum Newbie
Group: General Forum Members
Last Login: Monday, December 20, 2010 5:44 AM
Points: 2,
Visits: 5
I want to select all columns and get monthly total in my table.
how am i do this...
plz help me...
Post Attachments
abc.JPG
(
30 views,
55.57 KB
)
Post #1036345
LutzM
LutzM
Posted Friday, December 17, 2010 10:51 AM
SSCertifiable
Group: General Forum Members
Last Login: Wednesday, April 24, 2013 3:17 PM
Points: 6,731,
Visits: 12,131
Please read the first article in my signature on how to ask a question in this forum.
It'll show you how to post table def and sample data in a ready to use format.
Also, please include your expected output (not as jpg) and what you've tried so far.
Right now it looks like homework...
Lutz
A pessimist is an optimist with experience.
How to get fast answers to your question
How to post performance related questions
Links for
Tally Table
,
Cross Tabs
and
Dynamic Cross Tabs
,
Delimited Split Function
Post #1036660
parthi-1705
parthi-1705
Posted Friday, December 17, 2010 1:07 PM
Mr or Mrs. 500
Group: General Forum Members
Last Login: Wednesday, December 26, 2012 11:03 PM
Points: 586,
Visits: 2,195
ruwanwickrama (12/16/2010)
I want to select all columns and get monthly total in my table.
how am i do this...
plz help me...
Is this you are looking for
Select Project ,Location,Itemtype,Sum(Amount) From mytable Group by Project ,Location,Itemtype,MONTH(Date)
Thanks
Parthi
Thanks
Parthi
Post #1036720
ruwanwickrama
ruwanwickrama
Posted Friday, December 17, 2010 7:27 PM
Forum Newbie
Group: General Forum Members
Last Login: Monday, December 20, 2010 5:44 AM
Points: 2,
Visits: 5
Thanx Parthi,
Your answer very helpful to me...............
Post #1036828
Lynn Pettis
Lynn Pettis
Posted Saturday, December 18, 2010 4:00 PM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 12:02 AM
Points: 21,596,
Visits: 27,415
parthi-1705 (12/17/2010)
ruwanwickrama (12/16/2010)
I want to select all columns and get monthly total in my table.
how am i do this...
plz help me...
Is this you are looking for
Select Project ,Location,Itemtype,Sum(Amount) From mytable Group by Project ,Location,Itemtype,MONTH(Date)
Thanks
Parthi
This will work as long as your data does not span more than 12 consecutive months.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #1036929
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.