Table1
idPerson |
Date | SumHours | |
1 | 101 | 1394/02/16 | 8 |
2 | 102 | 1394/02/16 | 8 |
3 | 101 | 1394/02/17 | 8 |
4 | 101 | 1394/03/05 | 7 |
5 | 102 | 1394/03/05 |
4 |
SELECT idPerson , SUM(WorkHour) AS SumHours FROM Table1
GROUP BY idPerson
Resault:
idPerson | SumHours | |
1 | 101 | 23 |
2 | 102 | 12 |
SELECT idPerson , [Date] , SUM(WorkHour) AS SumHours FROM Table1 GROUP BY idPerson , [Date]
Resault:
idPerson | Date | SumHours | |
1 | 101 | 1394/02/16 | 8 |
2 | 102 | 1394/02/16 | 8 |
3 | 101 | 1394/02/17 | 8 |
4 | 101 | 1394/03/05 | 7 |
5 | 102 | 1394/03/05 | 4 |