Home » Developer & Programmer » Forms » Sum total quantity on form. (Oracle Form 10g.)
Sum total quantity on form. [message #530531] Tue, 08 November 2011 20:19 Go to next message
dophuong_cs
Messages: 92
Registered: May 2011
Location: Viet Nam
Member

Hi all,
I have problem about sum record on form.
This is records display on form.
NO      Merchandise      Slip           Quantity   
------------------------------------------------
15	2501B002CA	H2-0029800	16
16	2501B002CA	H1-0035287	16
14	2501B002CA	H1-0035298	12
12	2501B002CA	H2-0029793	16
13	2501B002CA	H2-0029796	12
20	2501B002CA	H1-0035296	12
21	2501B002CA	H1-0035297	16
19	2501B002CA	H2-0029795	16
17	2501B002CA	H2-0029787	16
18	2501B002CA	H1-0035291	16
11	2501B002CA	H1-0035292	12
4	2501B002CA	H1-0035300	12
5	2501B002CA	H2-0029789	16
3	2501B002CA	H2-0029798	12
1	2501B002CA	H2-0029788	12
2	2501B002CA	H2-0029791	16
9	2501B002CA	H1-0035288	12
10	2501B002CA	H2-0029792	12
8	2501B002CA	H2-0029797	16
6	2501B002CA	H2-0029794	12
7	2501B002CA	H1-0035293	16

Now, i want to count quantity follow slip_no and merchandise.
Example:
Merchandise :2501B002CA have 8 slip with quantity is 12 and 5 slip with quantity is 16.
Merchandise: 2501B001CA have 6 slip with quantity is 12 and 7 slip with quantity is 16.
Detail you can see file attach

-------
But i don't know how to do for result same above.
Please hepl me.
Thanks
Re: Sum total quantity on form. [message #530536 is a reply to message #530531] Wed, 09 November 2011 00:13 Go to previous messageGo to next message
Littlefoot
Messages: 21815
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
One option might be to create a view (that would pre-calculate these values); then, in a form, create another data block (based on that view). Master-detail relationship would be on the MERCHANDISE item.
Re: Sum total quantity on form. [message #530564 is a reply to message #530536] Wed, 09 November 2011 02:52 Go to previous messageGo to next message
dophuong_cs
Messages: 92
Registered: May 2011
Location: Viet Nam
Member

Detail i must how to do?
and haven't way others for this case.
Re: Sum total quantity on form. [message #530585 is a reply to message #530564] Wed, 09 November 2011 03:35 Go to previous messageGo to next message
cookiemonster
Messages: 13927
Registered: September 2008
Location: Rainy Manchester
Senior Member
Do you know how to write a query to get the totals?
You'd use count(*) and group by.
Then create a view based on the query.
Then create a datablock based on the view.

Try it. If you get stuck post what you did.
Re: Sum total quantity on form. [message #530586 is a reply to message #530585] Wed, 09 November 2011 03:36 Go to previous messageGo to next message
Littlefoot
Messages: 21815
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Wizard is capable of creating master-detail relationship.

Any other way? Probably ... for example, loop through all records and calculate values you are interested in, display them in another block (or, possibly, in a multi-line text item, doing some concatenation).
Re: Sum total quantity on form. [message #530827 is a reply to message #530586] Thu, 10 November 2011 21:25 Go to previous messageGo to next message
dophuong_cs
Messages: 92
Registered: May 2011
Location: Viet Nam
Member

You can write for me code about sum total with count(*) and group by.
Thanks.
Re: Sum total quantity on form. [message #530860 is a reply to message #530827] Fri, 11 November 2011 03:01 Go to previous messageGo to next message
cookiemonster
Messages: 13927
Registered: September 2008
Location: Rainy Manchester
Senior Member
CAn you try it for yourself?
It's not difficult, it's basic SQL, which you need to learn.
Re: Sum total quantity on form. [message #530874 is a reply to message #530860] Fri, 11 November 2011 03:32 Go to previous message
cookiemonster
Messages: 13927
Registered: September 2008
Location: Rainy Manchester
Senior Member
You need the count per something. You group by that something. Give it a try.
Previous Topic: chnage image in runtime
Next Topic: Problem with Button Control on tab pages
Goto Forum:
  


Current Time: Thu Aug 01 07:11:56 CDT 2024