running sum in form 6i [message #689912] |
Sat, 27 July 2024 02:57 |
shahzad-ul-hasan
Messages: 628 Registered: August 2002
|
Senior Member |
|
|
i want to use running sum in form 6i.please advise me.
Table
dsno number(5)
pname varchar2(80)
tdate date
bamt number(7)
ramt number(7)
Bal number(12)
Date
dsno pname tdate Bamt Ramt bal
1 Guchi 12-Jul-2024 12600 0 12600
2 Guchi 15-Jul-2024 11600 15000 9200
3 Guchi 17-Jul-2024 1600 0 10800
4 Guchi 18-Jul-2024 5600 0 16400
5 Guchi 19-Jul-2024 12600 3000 13400
[Updated on: Sat, 27 July 2024 02:58] Report message to a moderator
|
|
|
|
Re: running sum in form 6i [message #689916 is a reply to message #689915] |
Sat, 27 July 2024 06:27 |
shahzad-ul-hasan
Messages: 628 Registered: August 2002
|
Senior Member |
|
|
i have used this in Post-Query trigger:
declare
a number;
begin
SELECT nvl(sum(bamt),0)-nvl(sum(ramt),0) OVER (PARTITION BY tdate ORDER BY dsno
RANGE UNBOUNDED PRECEDING) into :n
FROM dsale_det
where pname=:pname;
exception when no_data_found then
:n:=0;
end;
error: encountered symbol when expecting one of the following
.from into
|
|
|
Re: running sum in form 6i [message #689921 is a reply to message #689916] |
Mon, 29 July 2024 05:25 |
cookiemonster
Messages: 13952 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
I doubt that forms 6i recognizes analytic sum and even if it did you couldn't use it in post-query like that.
You would need to create a view with the sum analytic in it and base the datablock on that.
|
|
|