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 |
|
Trudye
Posting Yak Master
169 Posts |
Posted - 2008-06-13 : 07:48:00
|
| Hi Guys, got a problem. I am trying to create a table of summarized fees. I was unable to do a Insert command so I settled for an Update command. But I ran into this error msg which I’m not sure how to fix. Can anyone see the problem or is it not even possible to Update and Compute in the same statement? Do I have to do a sub query?Update FEE_SUMs_20080402 SET LOAN_Num = F.DDLOAN, Fee_Amt = F.DDMFEEFROM FEE_Recs AS FINNER JOIN dbo.Addr_20080402 ONAccount_Num = F.DDLOANORDER BY F.DDLOANCOMPUTE SUM(F.DDMFEE) BY F.DDLOANMsg 156, Level 15, State 1, Line 7Incorrect syntax near the keyword 'ORDER'. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-13 : 07:51:04
|
| Can you explain what you're trying to do with some sample data? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-13 : 07:53:59
|
is it this?Update TSET T.LOAN_Num = F.DDLOAN, T.Fee_Amt = F.TotalDDMFEEFROM (SELECT DDLOAN,SUM(F.DDMFEE) AS TotalDDMFEEFROM FEE_Recs GROUP BY DDLOAN)AS FINNER JOIN dbo.Addr_20080402 TON T.Account_Num = F.DDLOAN |
 |
|
|
Trudye
Posting Yak Master
169 Posts |
Posted - 2008-06-13 : 12:29:56
|
| Thank you sooooo very much. You do good work, take a $100.00 out of Petty Cash and tell them I said it was ok. (lol) That query worked GREAT I didn't have to change a thing.Be well and have a great weekend,Trudye |
 |
|
|
|
|
|