I have a table that I need 1st grouped by Parent_Doc_No and then by Flight_Date and I need the hours totaled each time it hits a new date and add up the hours in the database from this date for this particular Parent_Doc_no. I am using SQL 2000 and I wanted to do a stored procedure. For example
Current Table:
Parent_Doc_No Flight_Date Hours 38 10/14/2006 3
38 10/15/2006 1
38 10/16/2006 2
40 9/1/2005 3
40 9/1/2005 1
Expected Outcome:
Parent_Doc_No Flight_Date Hours New Total
38 10/14/2006 3 6
38 10/15/2006 1 3
38 10/16/2006 2 2
40 9/1/2005 3 4
40 9/1/2005 1 1
Any Ideas?
Thanks Sandy