10
Answers

Problem with the SQL query

Nel

Nel

12y
5.9k
1

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)