Query Row number don't wotk with duplicate name

  • Thread starter Thread starter Ed Dror
  • Start date Start date
E

Ed Dror

Hi there,

How do I get query rows numbers?
I follow the Qry Sample that Microsoft provided

Rank: (Select Count (*) from qryNewWarehousechart Where [WK0] <
[WarehouseChart].[WK0])+1

But in my query I don't have an ID all my fields could be duplicates

My question is how to count row number regardless to the other field in the
query?

Lets take Northwind -> Products Category (assuming they don't have an
Primary Key ID)

Thanks
Ed Dror
 
I don't see quite what you are trying to do; if all you want is the number
of rows returned by the query, "Select count(*) from Myquery" will do this.

But if you are looking for the "row number" for a specific row, this is
completely different - and meaningless, since queries (like tables) don't
have row numbers - where a specific record occurs in the query result depends
on how the data is sorted.

John


Ed said:
Hi there,

How do I get query rows numbers?
I follow the Qry Sample that Microsoft provided

Rank: (Select Count (*) from qryNewWarehousechart Where [WK0] <
[WarehouseChart].[WK0])+1

But in my query I don't have an ID all my fields could be duplicates

My question is how to count row number regardless to the other field in the
query?

Lets take Northwind -> Products Category (assuming they don't have an
Primary Key ID)

Thanks
Ed Dror
 
Roger,

I will try a different approach (Temp Table with ID)



Because my query has Duplicate company name, Duplicate target field and
Percent field (no duplicate)

And it going inside report as a chart separate page per company (filter on
Company ID)

Basically I d-normalized the data to achieve this goal .



So The week axis doesn't have numbers and I tough if Is There any solution
(record number) for that



Thanks,
Ed Dror


Roger Carlson said:
If there isn't a unique identifier in your table, there should be. Can
you add an Autonumber field to your table for just this purpose?

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


Ed Dror said:
Hi there,

How do I get query rows numbers?
I follow the Qry Sample that Microsoft provided

Rank: (Select Count (*) from qryNewWarehousechart Where [WK0] <
[WarehouseChart].[WK0])+1

But in my query I don't have an ID all my fields could be duplicates

My question is how to count row number regardless to the other field in
the query?

Lets take Northwind -> Products Category (assuming they don't have an
Primary Key ID)

Thanks
Ed Dror
 
Back
Top