Numbering Rows
Numbering Rows
Numbering Rows
Numbering Rows
Numbering Rows
Numbering Rows Numbering Rows Numbering Rows Numbering Rows Numbering Rows Numbering Rows Numbering Rows Numbering Rows
Numbering Rows Numbering Rows
Numbering Rows
Go Back  Xtreme Visual Basic Talk > > > Numbering Rows


Reply
 
Thread Tools Display Modes
  #21  
Old 04-20-2004, 08:41 AM
Mikecrosoft's Avatar
Mikecrosoft Mikecrosoft is offline
Mexican Coder
 
Join Date: Jun 2002
Location: Monterrey, N.L., Mexico
Posts: 2,793
Default


Sorry, may be my english are confusing you, I'm trying to say this:

I attached 2 images, one is sorted by 'Matricula'
the other for 'Ap. Paterno', check the numbers of each reow, doesn't depends of the Matricula field (ID field : unique).

I hope make sense.

Thanks
Attached Images
File Type: jpg Sort1.JPG (35.8 KB, 8 views)
File Type: jpg Sort2.JPG (33.1 KB, 6 views)
__________________
Mikecrosoft.NET
* If I stop to ask I will stop to learn
* Just I know that I don't know nothing
Reply With Quote
  #22  
Old 04-20-2004, 11:14 AM
MKoslof's Avatar
MKoslofNumbering Rows MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

OK, well the main issue is, you need to sort by some unique value. You can change what field is sorted by (just change Field1 to something else in my example) but the changed values also needs to be unique. You say, you have a unique field, so you need to sort by that. If the other fields you WANT to sort by are not unique, you are basically out of luck.
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #23  
Old 04-20-2004, 11:18 AM
Mikecrosoft's Avatar
Mikecrosoft Mikecrosoft is offline
Mexican Coder
 
Join Date: Jun 2002
Location: Monterrey, N.L., Mexico
Posts: 2,793
Default

Thats the problem, the fields the user selects might be Non Unique, theres the problem with the idea you posted before.
__________________
Mikecrosoft.NET
* If I stop to ask I will stop to learn
* Just I know that I don't know nothing
Reply With Quote
  #24  
Old 04-20-2004, 11:24 AM
MKoslof's Avatar
MKoslofNumbering Rows MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Exactly, well the whole basis behind a row number, autonumber or identity field is to increment. An increment needs to be unique. An autonumber is never the same, the rowNum property of Oracle is never the same, etc. So, if the user is sorting by a column with non-unique values there is really no way to do this.

And, really, even if we created a new table and created our own Auto-increment field..the inital output could be something like this:

NEW TABLE

1 value test myTest
2 blah ha foo
3 aval koo shoe

If you run your query and sort by our *new* numbering field, you get the right results. But if you order by field2, 3, or 4..you have the same problem. There is a logical flaw in this......
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #25  
Old 04-20-2004, 11:28 AM
Mikecrosoft's Avatar
Mikecrosoft Mikecrosoft is offline
Mexican Coder
 
Join Date: Jun 2002
Location: Monterrey, N.L., Mexico
Posts: 2,793
Default

Exactly, thats why I needed this numeration as an agreggate function field, where the field doesn't stores the data (number) as a phisical number, but like a just number in the result of the query.
__________________
Mikecrosoft.NET
* If I stop to ask I will stop to learn
* Just I know that I don't know nothing
Reply With Quote
  #26  
Old 04-20-2004, 11:37 AM
Mikecrosoft's Avatar
Mikecrosoft Mikecrosoft is offline
Mexican Coder
 
Join Date: Jun 2002
Location: Monterrey, N.L., Mexico
Posts: 2,793
Default

My solution it was the next:

Due the Query string its builded by the users at runtime (they choose the fields to included in the report).

When the user selects the Row Number, I add one field of the DB (I chose one), then I fill the DataTable with the results, then If the Field is detected as a Row Number I change the data (Manually) of these fileds with the row numeration (doing a loop throught the DataTable rows), then I set the DataSource of my SpreadSheet to that DataTable, and voila !!! the row numeration is there, I needed to do this usign code, my question was to avoid this procedure, but, this is a forum and I dont like to leave question without an aswer, I posted that. If some one in the forum know an agregate funcion it had avoided this change of the code, please post it here because it will be usefull to more ppl and me .

Thanks guys for your help on this one, really appreciated.

Mike
__________________
Mikecrosoft.NET
* If I stop to ask I will stop to learn
* Just I know that I don't know nothing
Reply With Quote
  #27  
Old 04-20-2004, 01:47 PM
MKoslof's Avatar
MKoslofNumbering Rows MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

I don't think you'll find any sort of aggregate function for this..the database engine has no way of creating these numbers for you. Your workaround is the probably the only method you are going to find. You might try looking into a TRANSFORM query, this would create a Cross Tab query in Access, but you probably would run into the same problems.
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Select and delete last 15 rows zreclay Excel 1 03-18-2004 09:16 PM
How do I highlight multiple rows in flexgrid randomly berdy General 4 09-09-2003 03:58 AM
Indefinite Rows bobba buoy Excel 6 07-07-2003 02:24 PM
MSHFLEXGRID adding rows + FOCUSRECT Maximus General 2 02-05-2003 07:44 AM
Setting # of rows in a MSFlexgrid during runtime Wargasm General 4 08-23-2001 02:29 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Numbering Rows
Numbering Rows
Numbering Rows Numbering Rows
Numbering Rows
Numbering Rows
Numbering Rows Numbering Rows Numbering Rows Numbering Rows Numbering Rows Numbering Rows Numbering Rows
Numbering Rows
Numbering Rows
 
Numbering Rows
Numbering Rows
 
-->