IMCCoy
IS-IT--Management
- Apr 24, 2009
- 2
I'm accessing a Pervasive.SQL 9.61 database using ODBC and I need some help coming up with a SQL statement. I haven't used Pervasive before so any help is appreciated. I'm programming using C# in Visual Studio 2008. Here's my info:
Table 1
Cost_Codes:
Job
Cost_Code
Description
Table 2
Job_Cost:
Job
Cost_Code
Cost_Code_Cat
WTD_Units
WTD_Cost
I need to SUM the WTD_Units in one field and WTD_Cost in another field based on Job and Cost_Code. So, these are the fields I need to return:
Cost_Code.Job, Cost_Code.Cost_Code, Cost_Code.Description, SUM(Job_Cost.WTD_Units), SUM(Job_Cost.WTD_Cost)
Thanks for any help!
Table 1
Cost_Codes:
Job
Cost_Code
Description
Table 2
Job_Cost:
Job
Cost_Code
Cost_Code_Cat
WTD_Units
WTD_Cost
I need to SUM the WTD_Units in one field and WTD_Cost in another field based on Job and Cost_Code. So, these are the fields I need to return:
Cost_Code.Job, Cost_Code.Cost_Code, Cost_Code.Description, SUM(Job_Cost.WTD_Units), SUM(Job_Cost.WTD_Cost)
Thanks for any help!