| Author |
Topic |
|
mkgmahi
Starting Member
24 Posts |
Posted - 2011-12-22 : 06:02:41
|
| I want to retrieve data monthywise from Jan to decand to show the summary for the fields in the tableI have a date column in the table.What is the function.How it can to be done...please advice |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-22 : 06:07:32
|
| GROUP BY DATEADD(mm,DATEDIFF(mm,0,datefield),0) and then take SUM() your required fields.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
mkgmahi
Starting Member
24 Posts |
Posted - 2011-12-22 : 06:50:46
|
| Thank you,,,, i will try this |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-22 : 10:39:30
|
try and let us know ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
mkgmahi
Starting Member
24 Posts |
Posted - 2011-12-24 : 01:31:17
|
| Thank you so much visakh. It was was working fine.But how will i describe each row JAN to dec x y 1 3052 3553 3704 3775 4106 4117 4508 4809 51110 51911 54012 583 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-24 : 02:50:12
|
| where are you showing the data? if its some reporting tool, you can use datefunctions to retrieve the month value------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
mkgmahi
Starting Member
24 Posts |
Posted - 2011-12-24 : 02:56:44
|
| Hi vishakh,I have used datename function and its working.Thanks |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-24 : 02:58:49
|
| wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|