Click here to Skip to main content
15,917,604 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Daily exam

Student_id--   Marks --   Date 
  1--	      10  --     30/01/2012
  1           20       25/01/2012
  1           10       20/01/2012
  1           40       11/01/2012
  2	      30       30/01/2012
  2           60       25/01/2012
  2           90       20/01/2012
  2           50       11/01/2012

  1	      20       30/02/2012
  1           20       25/02/2012
  1           10       20/02/2012
  1           40       11/02/2012
  2	      30       30/02/2012
  2           60       25/02/2012
  2           20       20/02/2012
  2           50       11/02/2012

i want out put like

Monthly wice means out put like with parameters of From Date and to date given as inputs

Student_id   Marks    Date 
   1          80       jan 2012
   2          230      jan 2012
   1          90       feb 2012
   2          160      feb 2012


if
Yearly wice means out put like with parameters of From Date and to date given as inputs

Student_id   Marks    Date 
   1          160       2012
   2          390      2012




any one please help me

[edit]Code block added - OriginalGriff[/edit]
Posted
Updated 5-Feb-13 2:34am
v2
Comments
Ankur\m/ 5-Feb-13 8:22am    
What have you tried?
Try grouping by Studentid and month part of the date (for monthly report) / year part of the date (for yearly report). And show us your results.

1 solution

You can SUM(marks) and GROUP BY Year([Date]), Month([Date]), Student_id

Just give it a try.

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900