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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 subtracting?

Author  Topic 

brendalisalowe
Constraint Violating Yak Guru

269 Posts

Posted - 2007-01-15 : 11:47:21
What does this not work?

UPDATE tblCapRec
SET AfterFee = RefundAmt FeeAmount
WHERE Status = 2

I get this error: Line 2: Incorrect syntax near ''.

Thanks for your time!

Brenda

If it weren't for you guys, where would I be?

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2007-01-15 : 11:55:21
where's the minus sign in the SET statement?
The . being complaained about si external to this code....possibly further down your screen...(and not posted here)
Go to Top of Page

brendalisalowe
Constraint Violating Yak Guru

269 Posts

Posted - 2007-01-15 : 12:02:14
It must have not gotten copied over.

UPDATE tblCapRec
SET AfterFee = RefundAmt - FeeAmount
WHERE Status = 2

Brenda

If it weren't for you guys, where would I be?
Go to Top of Page

brendalisalowe
Constraint Violating Yak Guru

269 Posts

Posted - 2007-01-16 : 21:47:56
Any ideas? This is the error:

Line 2: Incorrect syntax near '-'.

Brenda

If it weren't for you guys, where would I be?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-17 : 00:50:16
Do the three columns actually exist in the table?

Try this
UPDATE [tblCapRec]
SET [AfterFee] = [RefundAmt] - [FeeAmount]
WHERE [Status] = 2


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -