Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Get Monthly total in sp Expand / Collapse
Author
Message
Posted Thursday, December 16, 2010 11:38 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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 (31 views, 55.57 KB)
Post #1036345
Posted Friday, December 17, 2010 10:51 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Tuesday, April 01, 2014 9:38 AM
Points: 6,908, Visits: 12,624
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
Posted Friday, December 17, 2010 1:07 PM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr 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
Posted Friday, December 17, 2010 7:27 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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
Posted Saturday, December 18, 2010 4:00 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 6:33 PM
Points: 22,475, Visits: 30,157
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 »

Add to briefcase

Permissions Expand / Collapse