Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 4th, 2004, 06:08 AM
Registered User
 
Join Date: Nov 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default MS Access

Is there any way to rank dates using queries (without the use of vba)?
I have a table which contains 10 week dates, by using a query I would like to insert a column with a rank for each date. The rank represents the chronological date ordering and will be used as report headers to form a crosstab query for financial forecast reporting. As the data changes week by week new dates are added to the database.

Date: Rank:
09/08/2004 1
16/08/2004 2
23/08/2004 3
30/08/2004 4
06/09/2004 5
13/09/2004 6
20/09/2004 7


 
Old November 5th, 2004, 06:03 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

you can use "rownum" will give you the record position.



Gokulan Ethiraj
 
Old November 5th, 2004, 06:51 AM
Registered User
 
Join Date: Nov 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Could you please give me some examples of "Rownum". The problem is if its VBA which determine the row number, when the query is executed in MS Access, this will lock other users from running the same query.

 
Old November 9th, 2004, 01:37 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You could use autonumber in your table, not in the query, as a field if you are entering weeks in order.

You might have:

tblDates
   PK AutoNumber
   Date Date
   Rank AutoNumber

   The problem is if you enter a week out of order, then your Rank gets out of order. You could manually chenge it if necessary.




mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Ms Access report to MS Word doc kite Access 1 October 22nd, 2007 01:45 AM
Database migration MS Access 2003 to MS SQL 2000 ayazhoda SQL Server 2000 3 April 23rd, 2007 11:38 AM
MS ACCESS 2003 FRONTEND AND MS SQL SERVER 2005 DB mohankumar0709 SQL Server 2005 3 March 23rd, 2007 12:48 AM
MS Data Grid control in ms access application roshla_p Access VBA 5 October 16th, 2006 02:37 AM
Exporting data from MS Excel sheet to Ms Access ajindal General .NET 1 January 17th, 2005 03:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.