Please can someone help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • trsiskotr
    New Member
    • Jul 2008
    • 1

    Please can someone help

    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 InvestmentSumma ry
    Set UnitsOut = -17849.26409
    where InvestmentSumma ryUID = 140401

    Set AmountOut = 978.63
    where InvestmentSumma ryUID = 141607

    Set AmountOut = 40773.07
    where InvestmentSumma ryUID = 141603

    Set AmountOut = 2622.05
    where InvestmentSumma ryUID = 141608

    Set AmountOut = -1775.192389
    where InvestmentSumma ryUID = 140404

    Set AmountOut = -662.557438
    where InvestmentSumma ryUID = 140403

    --select distinct si.investmentui d,isum.investme ntsummaryuid,is um.unitsout,isu m.amountout
    from investmentsumma ry isum
    inner join schemeinvestmen t si on si.schemeinvest mentuid = isum.schemeinve stmentuid
    where investmentsumma ryuid in (select distinct tx.istxuid
    from transactionssha dow tx
    inner join memberinvestmen t mi on mi.memberinvest mentuid = tx.parentuid
    inner join memberbenefit mb on mb.memberbenefi tuid = mi.memberbenefi tuid
    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.accounttrans actionuid in (@accounttransa ctionuid)
    and p.nationalidnum ber = @nino
    and tx.rectype = 'D'
    and mi.investmentui d in (1028614,102861 5,1028616,17423 76,1787194))
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Code:
    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
    Is this your query?
    If so I suggest you study some SQL. You can only have one WHERE clause.

    Comment

    • ck9663
      Recognized Expert Specialist
      • Jun 2007
      • 2878

      #3
      or you can use the CASE...WHEN...E ND function

      -- CK

      Comment

      Working...