Connecting Tech Pros Worldwide Forums | Help | Site Map

Please can someone help

Newbie
 
Join Date: Jul 2008
Posts: 1
#1: Jul 28 '08
I seem to get the following error on the line with setamount - 978.

Server: Msg 170, Level 15, State 1, Line 13
Line 13: Incorrect syntax near '='.

any ideas?

update InvestmentSummary
Set UnitsOut = -17849.26409
where InvestmentSummaryUID = 140401

Set AmountOut = 978.63
where InvestmentSummaryUID = 141607

Set AmountOut = 40773.07
where InvestmentSummaryUID = 141603

Set AmountOut = 2622.05
where InvestmentSummaryUID = 141608

Set AmountOut = -1775.192389
where InvestmentSummaryUID = 140404

Set AmountOut = -662.557438
where InvestmentSummaryUID = 140403

--select distinct si.investmentuid,isum.investmentsummaryuid,isum.un itsout,isum.amountout
from investmentsummary isum
inner join schemeinvestment si on si.schemeinvestmentuid = isum.schemeinvestmentuid
where investmentsummaryuid in (select distinct tx.istxuid
from transactionsshadow tx
inner join memberinvestment mi on mi.memberinvestmentuid = tx.parentuid
inner join memberbenefit mb on mb.memberbenefituid = mi.memberbenefituid
inner join schememember sm on sm.memberuid = mb.memberuid
inner join employee ee on ee.employeeuid = sm.employeeuid
inner join person p on p.personuid = ee.personuid
where tx.accounttransactionuid in (@accounttransactionuid)
and p.nationalidnumber = @nino
and tx.rectype = 'D'
and mi.investmentuid in (1028614,1028615,1028616,1742376,1787194))

code green's Avatar
Expert
 
Join Date: Mar 2007
Location: England
Posts: 1,079
#2: Jul 28 '08

re: Please can someone help


Expand|Select|Wrap|Line Numbers
  1. update InvestmentSummary
  2. Set UnitsOut = -17849.26409
  3. where InvestmentSummaryUID = 140401
  4.  
  5. Set AmountOut = 978.63
  6. where InvestmentSummaryUID = 141607
  7.  
  8. Set AmountOut = 40773.07
  9. where InvestmentSummaryUID = 141603
  10.  
  11. Set AmountOut = 2622.05
  12. where InvestmentSummaryUID = 141608
  13.  
  14. Set AmountOut = -1775.192389
  15. where InvestmentSummaryUID = 140404
  16.  
  17. Set AmountOut = -662.557438
  18. where InvestmentSummaryUID = 140403
Is this your query?
If so I suggest you study some SQL. You can only have one WHERE clause.
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,925
#3: Jul 28 '08

re: Please can someone help


or you can use the CASE...WHEN...END function

-- CK
Reply