calculate the exact balance [message #431580] |
Wed, 18 November 2009 05:47 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
shahzad-ul-hasan
Messages: 643 Registered: August 2002
|
Senior Member |
|
|
-----Table-2
Date date
Id number(5)
item-id number(4)
op_qty number(5)
pur number(5)
issue number(5)
balance number(5)
----------------------------------------------
Data
date item Name Op_qty Pur-Qty Issue_Qty Bal
1/1/9 1 sigular 5 6 3 8
2/1/9 1 sigular 8 2 4 6
4/1/9 1 sigular 6 4 4 6
6/1/9 1 sigular 6 12 7 11
-------------------------------------------------------------
how u find these running op_qty and stcok balance.
pls help me
-
Attachment: untitled.JPG
(Size: 33.18KB, Downloaded 675 times)
|
|
|
|
|
|
|
|
Re: calculate the exact balance [message #431751 is a reply to message #431580] |
Thu, 19 November 2009 06:23 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
shahzad-ul-hasan
Messages: 643 Registered: August 2002
|
Senior Member |
|
|
have tried. but thge result is little diffrent.i will expalin again. (Master/Detail)
Date: 19-Nov, 2009 Master table
Details table
S-no Type Op In Out Balance
1. Sulzer 25 3 2 26
2. Sulzer Loom 26 2 5 23
3. Sulzer Loom 23 0 7 16
4. Sulzer Loom 16 3 5 14
Opening and closing balance required.
regards
|
|
|
Re: calculate the exact balance [message #431754 is a reply to message #431751] |
Thu, 19 November 2009 06:26 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68733 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Michel Cadot wrote on Wed, 18 November 2009 13:17Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Define the meaning of the column and how one is calculated from others.
Regards
Michel
Not aligned table is unreadable.
I will not hurt my eyes to help you.
Help me to help you in posting in an easy to read way.
[Updated on: Thu, 19 November 2009 06:27] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: calculate the exact balance [message #432485 is a reply to message #431580] |
Tue, 24 November 2009 07:54 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
It should also be noted that you should never do calculations in KEY-NEXT_ITEM. Users can always bypass this trigger - by using the mouse for example.
KEY-NEXT_ITEM should be used for specialised navigation code and nothing else.
|
|
|
|
|
Re: calculate the exact balance [message #436149 is a reply to message #435991] |
Mon, 21 December 2009 20:49 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
shahzad-ul-hasan
Messages: 643 Registered: August 2002
|
Senior Member |
|
|
Thx david.
i am working on it.but execute_query will not help me to get exact balance calculation.
NVL(:op_Bal,0)+NVL(:in,0)-nvl(:out,0) not helpable...
pls advised if this can be calculated in select statement.
|
|
|
Re: calculate the exact balance [message #436184 is a reply to message #436149] |
Tue, 22 December 2009 01:04 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
kame
Messages: 69 Registered: July 2009
|
Member |
|
|
Shahzad
tell me what columns do u have in your forms?
what you want to do on form?
u should use select statement with where clause
like
for Opening Balance
select sum(b.in), sum(b.out), Sum(b.in) - Sum(b.out) OPN from Master a , detail b
where a.primarykey = b.primarykey
and date < :Tempdate;
and if u have opening balance in other table then u can add this query
|
|
|