473,399 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Sum hours from the date on this row thruout the rest of the database.

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
Nov 21 '06 #1
1 1281
willakawill
1,646 1GB
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
Hi
The expected outcome is not grouped by either Parent_Doc_No or Flight_Date. So could you explain again what you want?
Nov 22 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Rebecca Smith | last post by:
I'm building log book to keep track of a racers stats during a long ultra marathon race. Things such as time on the bike, time off, H20 intake, electrolytes and the like. When I say long I mean...
1
by: serge | last post by:
Right now the database I am working with is storing time in an Integer data type and is storing the time value in seconds. The application does not allow entering seconds. It accepts minutes and...
1
by: deena22 | last post by:
hello, i'm using 'Access database' and VB 6.0. My database is named ' timesheet' and it contains a table named 'tabletimesheet'. The table contain the following fields: 'staffname, stafftype,...
18
by: Dirk Hagemann | last post by:
Hello, From a zone-file of a Microsoft Active Directory integrated DNS server I get the date/time of the dynamic update entries in a format, which is as far as I know the hours since january 1st...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.