Using MS Access/Auto number

Advertisement


Question
Hi

I want to auto number / rank a set of records in a query, which starts again when a particular field changes.

I have this working in SQL, effectively I want to replicate the field below:
SELECT ROW_NUMBER() OVER (PARTITION BY REPORTING_NAME ORDER BY ADMISSION_DATE ASC) AS RowNo

However I need to put this into practice in Access if possible and can't quite get my head around it at the moment?
Jon

Answer
I'm not clear what you mean by putting this into practice in Access. Access queries ARE SQL. You can open Query Design mode and switch to SQL View and type in your SQL directly.

Do you need to permanently store this # or is it just for ranking in a query?

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA

©2016 About.com. All rights reserved.