Home » Developer & Programmer » Forms » calculate the exact balance (form 6/6i. )
calculate the exact balance [message #431580] Wed, 18 November 2009 05:47 Go to next message
shahzad-ul-hasan
Messages: 454
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 167 times)
Re: calculate the exact balance [message #431590 is a reply to message #431580] Wed, 18 November 2009 06:17 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please 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
Re: calculate the exact balance [message #431591 is a reply to message #431580] Wed, 18 November 2009 06:21 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 454
Registered: August 2002
Senior Member
ok Michel Cadot,i will take care.please see the attached file,.
Re: calculate the exact balance [message #431597 is a reply to message #431591] Wed, 18 November 2009 07:05 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Sorry can't download file.
Post it inline.

Regards
Michel
Re: calculate the exact balance [message #431723 is a reply to message #431580] Thu, 19 November 2009 04:35 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 454
Registered: August 2002
Senior Member
Dear Michal,
pls see the attached file.
Re: calculate the exact balance [message #431724 is a reply to message #431723] Thu, 19 November 2009 04:52 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Michel Cadot wrote on Wed, 18 November 2009 14:05
Sorry can't download file.
Post it inline.

Regards
Michel

Re: calculate the exact balance [message #431751 is a reply to message #431580] Thu, 19 November 2009 06:23 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 454
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 messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Michel Cadot wrote on Wed, 18 November 2009 13:17
Please 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 #431894 is a reply to message #431580] Thu, 19 November 2009 20:06 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 454
Registered: August 2002
Senior Member
./fa/7049/0/
Re: calculate the exact balance [message #431900 is a reply to message #431894] Thu, 19 November 2009 23:04 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Isn't balance = opening + in - out?

Regards
Michel
Re: calculate the exact balance [message #431950 is a reply to message #431900] Fri, 20 November 2009 03:35 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 454
Registered: August 2002
Senior Member
it is not the simple way.i need when i change my date it will show me the previous bal. i will add in and then i out the quantity.
Re: calculate the exact balance [message #431951 is a reply to message #431950] Fri, 20 November 2009 03:36 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Isn't the previous balance in "opening"?

Regards
Michel
Re: calculate the exact balance [message #431986 is a reply to message #431951] Fri, 20 November 2009 05:20 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 454
Registered: August 2002
Senior Member
i am using form. so i want this to be in Key next item Trigger.
with some query.it is possible.
icon6.gif  Re: calculate the exact balance [message #432456 is a reply to message #431986] Tue, 24 November 2009 05:53 Go to previous messageGo to next message
coolbunny111
Messages: 12
Registered: June 2009
Junior Member
go to property palette of Balance column in form
go to calculation option.
choose calculation mode to formula
write in formula


                NVL(:op_Bal,0)+NVL(:in,0)-nvl(:out,0)


this will automatically calculate your balance as soon as you change either of your three components.

Hope this will help. Smile Smile
Re: calculate the exact balance [message #432485 is a reply to message #431580] Tue, 24 November 2009 07:54 Go to previous messageGo to next message
cookiemonster
Messages: 12320
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 #432628 is a reply to message #432456] Wed, 25 November 2009 05:30 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 454
Registered: August 2002
Senior Member
Dear
but i want the balance coulumn autmetcially posted in opening.pls advised
Re: calculate the exact balance [message #435991 is a reply to message #432628] Sun, 20 December 2009 22:37 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you solved your problem?

In 'When-New-Form-Instance' go to your block and perform an 'execute_query'.

David
Re: calculate the exact balance [message #436149 is a reply to message #435991] Mon, 21 December 2009 20:49 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 454
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
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


Previous Topic: Sending commands to an external application
Next Topic: Passing Parameter from Web Page to Form 6i
Goto Forum:
  


Current Time: Sun Sep 25 14:32:08 CDT 2016

Total time taken to generate the page: 0.09487 seconds