Nel

Nel

  • NA
  • 716
  • 1.1m

Problem with the SQL query

Jul 11 2012 4:48 AM

Hi,


Can anybody tell me please what's wrong with my sql  query? Here is the code:

ALTER procedure [dbo].[presmSal]
(
@data DateTime,
@saldo decimal
)
as


select sum(iznosden) as priem
from blagajna_jspturs
where data=@data and vp>0 and vp<=10

select sum(iznosden) as isplata
from blagajna_jspturs
where vp>10 and data=@data

update Kasovizvestaj

set
saldo=@saldo + (priem) - (isplata) 
return


Thanks


Answers (10)