Hello,
I have a page where I fetch and display the records for a complicated query. Let us consider, that it fetches colA, colB, and colC.
I am displaying it Table Format, with the provision to sort the records by colA, colB or colC. I mean, the user will click the heading of each column to sort; and when they do that, I simply pass the columnName as the sort key to the same page through QueryString.
In the page, I have a duplicate removal technique, where I am comparing colA of two adjacent rows like this :-
At the end of table I am displaying the recordcount.
Here is where I face the problem ; for each time the user clicks on the heading of the column, the sort order varies and therefore the above loop returns different number of records for every sort made, because, the above loop will be logically correct only if the sorting is based on colA. For others, the loop, though works, is logically incorrect; I mean, as I said, it returns different number of rows each time.
Kindly help me to avoid this ugly situation and help me in displaying same number of records, whatever the sort key is.
Thank you...
RR
I have a page where I fetch and display the records for a complicated query. Let us consider, that it fetches colA, colB, and colC.
I am displaying it Table Format, with the provision to sort the records by colA, colB or colC. I mean, the user will click the heading of each column to sort; and when they do that, I simply pass the columnName as the sort key to the same page through QueryString.
In the page, I have a duplicate removal technique, where I am comparing colA of two adjacent rows like this :-
Code:
WHILE NOT objRec.EOF
IF temp2 <> objRec.Fields("colA") THEN
....
/**Displaying the
recordset in table format**/
END IF
temp2 = objRec.Fields("colA")
objRec.MoveNext
WEND
At the end of table I am displaying the recordcount.
Here is where I face the problem ; for each time the user clicks on the heading of the column, the sort order varies and therefore the above loop returns different number of records for every sort made, because, the above loop will be logically correct only if the sorting is based on colA. For others, the loop, though works, is logically incorrect; I mean, as I said, it returns different number of rows each time.
Kindly help me to avoid this ugly situation and help me in displaying same number of records, whatever the sort key is.
Thank you...
RR