Hi,
Had a good search here but can't see anything that gets my mind in gear for this one.
Basically I have a table call Diaries, this contains fields such as StartTime EndTime, I need to do a calculation that works out the difference in minutes between StartTime and EndTime. then for each row that fits that day I need to add up the result in minutes.
something like
Select DiaryID, TotalMinutes from (Select (EndTime - StartTime) / 60 AS SubTotalMins from Diary Where ID = Diary.ID) AS FirstSelect (Sum(FirstSelect.SubTotalMins) As TotalMinutes Where ID = Diary.ID
the above is rubbish of course but you can see what I am trying to work out.
for each row work out the difference between End and Start in minutes for all rows that match the where clause sum return the sum.
Any ideas?
Regards