Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Jeffrey_D_York
Starting Member
2 Posts |
Posted - 2004-07-19 : 10:32:15
|
| Hi- Can anyone point me in the right direction on how to do the following.I have a table with the following example entries. WorkOrder STORE WO_Date LaborDolars PartsDollars123 FGO 5/22/2004 23.0000 72.0000123 FGO 5/22/2004 49.0000 16.0000123 FGO 5/29/2004 17.0000 24.0000124 FGO 5/22/2004 18.0000 32.0000I need to have one entry where WorkOrder+Store+WO_Date are identical, yet adding the Labor Dollars and PartsDollars for a cumulative value to be inserted into another table.My end result needs to be this for the 123 fgo 5/22/2004 entries:WorkOrder STORE WO_Date LaborDolars PartsDollars123 FGO 5/22/2004 72.0000 88.0000 Any help is appreciated. Thanks! |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2004-07-19 : 10:34:42
|
| Group BySekect WorkOrder,STORE,WO_Date,LaborDollars = sum(LaborDollars),PartsDollars = sum(PartsDollars)From yourTableGroup By WorkOrder, STORE, WO_DateCorey |
 |
|
|
|
|
|