This topic is locked

Creating an additional column

2/11/2007 3:55:31 AM
ASPRunnerPro General questions
E
ebolisa author

Hi,

I'm displaying agents' sales ranking based on query. I'd like to add a column with sequential numbers (Basically numbering the rows...1, 2, 3, etc) to make easy to distinguish who's the first, the second, etc.

Can someone help with the code, pls.

Thank you.

Emilio

Built 255 - MSSQL2K

E
ebolisa author 2/11/2007

Error on my built. It's 225...

J
Jane 2/15/2007

Emilio,
you can do the following:

  1. add field on the Edit SQL query tab.
    select FieldName,

    FieldName as field123

    ...

    from TableName


2. rebuild your pages
3. open generated ..._list.asp file, find this line:

while not rs.eof and recno<=PageSize

and add following code just before:

dim value123

value123=0



4. find this code snippet:

' field123 - FieldType

value=""

value = ProcessLargeText(GetData(rs,"field123", "FieldType"),"field=field123" & keylink,"",MODE_LIST)

row.Add col & "field123_value",value123



and replace it with this one:

' field123 - FieldType

value=""

value123 = value123 + 1

row.Add col & "field123_value",value123



where FieldType is your actual field type of the field123 field.