This topic is locked

ListPage Column Total

11/27/2008 5:42:48 AM
ASPRunnerPro General questions
E
erdinoxyz author

Hi.

Fields Order and Totals settings

Calculating "Fields Order and Totals" settings with in List Page column Total (Per Page 20 record For exsample FieldName1 Column Totals= 12)

I want column total in top List Page (Not 20 records. All records. For exsample : FieldName1 Column Totals = 12345)

J
Jane 11/27/2008

Hi,
use custom event (Insert ASP code snippet option on the Visual Editor tab) for this purpose.

Select global total and then print it on the page:

str = "select sum(FieldName) from TableName"

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection
Response.write "Global Total: " & rstmp(0)

rstmp.close

set rstmp=nothing

E
erdinoxyz author 11/27/2008

Very Thanks

This code it good works

C
Codea 12/6/2008

Hi Guys,

I have a very similar issue to this Topic. My variation is that I want to add $205.00 to the sum total of a field after I have searched for a reference no. I have created this as custom custom event, is this the right place to do it? My variation is as follows:
str = "select CAST((sum(Interest_Accrued)+205) as decimal(10,2)) AS Price from TableName where Fieldname2=$Fieldname2_value"

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection
Response.write "" & rstmp(0)

rstmp.close

set rstmp=nothing
I keep getting incorrect syntax near $Fieldname2_value. The $Fieldname2_value is the reference number I have entered in the search field on the list page. What am I doing wrong and is this the right way to do it?
Any help would be greatly appreciated!

Cheers

Tony <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=35777&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

J
Jane 12/8/2008

Tony,
you need to define Fieldname2_value before.

Here is a sample:

Fieldname2_value = request.querystring("SearchFor")

str = "select CAST((sum(Interest_Accrued)+205) as decimal(10,2)) AS Price from TableName where Fieldname2=" & Fieldname2_value

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection
Response.write "" & rstmp(0)

rstmp.close

set rstmp=nothing

C
Codea 12/8/2008

Hi Jane,

Excellent, Worked a treat! Thank you soooo much.

If I don't bother you before hand, I'd like to wish you and the team a Merry Xmas and prosperous New Year.

Keep up the great work!

Speak Soon.

Tony <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=35807&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />