Forums
This topic is locked
Show the summ of a Repeated field
Posted 16 Nov 2001 17:58:00
1
has voted
16 Nov 2001 17:58:00 gwada gwada posted:
Hi all, i use ud4, and i have a repeated field with numbers, and text (example field, Name, money), and i would like to do the summ of the repeated field money, how can i do that??ThanxReplies
Replied 17 Nov 2001 04:57:08
17 Nov 2001 04:57:08 Joel Martinez replied:
hey, I don't know if there's an ultradev solution to this, but I do know that the answer you seek can be easily coded...
1. find the piece of code that spits out the result of the money field
(ie. <%=recordset1.fields("theMoney"
%><img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
2. turn that, into this:
<%
total = total + recordset1.fields("theMoney"
%>
3. then find the end of the loop, this will usually be a "wend" or a "loop" keyword, and add this <b>After</b> the loop is finished:
<%=formatCurrency(total)%>
of course you will have to account for formatting (ie. make sure it's not between table rows), and that should take care of you.
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
1. find the piece of code that spits out the result of the money field
(ie. <%=recordset1.fields("theMoney"

2. turn that, into this:
<%
total = total + recordset1.fields("theMoney"

%>
3. then find the end of the loop, this will usually be a "wend" or a "loop" keyword, and add this <b>After</b> the loop is finished:
<%=formatCurrency(total)%>
of course you will have to account for formatting (ie. make sure it's not between table rows), and that should take care of you.
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
Replied 17 Nov 2001 17:20:08
17 Nov 2001 17:20:08 Viktor Farcic replied:
Other solution is to create Query/View that will calculate summ.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
hey, I don't know if there's an ultradev solution to this, but I do know that the answer you seek can be easily coded...
1. find the piece of code that spits out the result of the money field
(ie. <%=recordset1.fields("theMoney"
%><img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
2. turn that, into this:
<%
total = total + recordset1.fields("theMoney"
%>
3. then find the end of the loop, this will usually be a "wend" or a "loop" keyword, and add this <b>After</b> the loop is finished:
<%=formatCurrency(total)%>
of course you will have to account for formatting (ie. make sure it's not between table rows), and that should take care of you.
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
hey, I don't know if there's an ultradev solution to this, but I do know that the answer you seek can be easily coded...
1. find the piece of code that spits out the result of the money field
(ie. <%=recordset1.fields("theMoney"

2. turn that, into this:
<%
total = total + recordset1.fields("theMoney"

%>
3. then find the end of the loop, this will usually be a "wend" or a "loop" keyword, and add this <b>After</b> the loop is finished:
<%=formatCurrency(total)%>
of course you will have to account for formatting (ie. make sure it's not between table rows), and that should take care of you.
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 07 Feb 2004 00:29:48
07 Feb 2004 00:29:48 Rick Rick replied:
I need a little input on this issue.
I have used the <pre id=code><font face=courier size=2 id=code> <%
subtotal = subtotal + recordset1.field("theMoney"
%></font id=code></pre id=code> to get the total of repeat region and what I am trying to do is add the sum of the repeat region and a coulmn for another recordedset. I have used the following but it fails when I try this.
<pre id=code><font face=courier size=2 id=code> <%GrandTotal = subtotal + OrderDetailsRS.fields("shipping"
%>
</font id=code></pre id=code>
Can some one help with this? Is there somthing that I am missing?
Edited by - redbaran on 07 Feb 2004 00:30:54
I have used the <pre id=code><font face=courier size=2 id=code> <%
subtotal = subtotal + recordset1.field("theMoney"

%></font id=code></pre id=code> to get the total of repeat region and what I am trying to do is add the sum of the repeat region and a coulmn for another recordedset. I have used the following but it fails when I try this.
<pre id=code><font face=courier size=2 id=code> <%GrandTotal = subtotal + OrderDetailsRS.fields("shipping"

</font id=code></pre id=code>
Can some one help with this? Is there somthing that I am missing?
Edited by - redbaran on 07 Feb 2004 00:30:54