I have a simple table called WorkDuration which contains a field WorkedHour from type varchar.
For Instance:
WorkedHour:
04:23
08:15
02:00
Now I want sum(WorkedHour) from WorkDuration.
For that I have tried the following line of code to get the total duration which is working, but not correctly.
database.ExecuteScalarAsync<int?>("SELECT SUM(WorkedHour) FROM WorkDuration WHERE WorkedHour > 0");
So how can I sum all WorkedHour's columns to have the total duration like following:
WorkedHour:
04:23
08:15
02:00
-----------
Total: 14:38 Hours
It would be a pleasure if someone could help me.
Thanks in advance.