tags:

views:

10

answers:

1

eg. i have records like this in my table.

  Name     Date        Salary
  Raja     01/10/2000   5000
  Raja     02/10/2000   5000
  Raja     03/10/2000   5000
  Anu      01/10/2000   3000
  Anu      02/10/2000   3000
  Anu      03/10/2000   3000
  King     01/10/2000   4000
  King     02/10/2000   4000
  King     03/10/2000   4000

i want to take print like the below eg using crystal report. (sum all the salary and display in single row).

Salary from 01/10/1981 To 03/10/1981

  NAME      Salary
  Raja      15,000
  Anu        9,000
  King      12,000
A: 

use a simple sql statement, with group-by clause and sum on the salary column.

select Name, Sum(salary) 
from table
group by Name
Dani