473,490 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Adding an autonumber that resets every month

1 New Member
I have a simple SQL server table with 4 fields - id, date, transactions.
I want to create an additional column that gives the ranking of each record within that month based on the number of transactions.
Is there any easy way to do this ?
Apr 3 '08 #1
2 1940
debasisdas
8,127 Recognized Expert Expert
If you want only for display purpose no need tro create an addition column.
Apr 4 '08 #2
Brad Orders
21 New Member
I would suggest that the approach that you take will depend on what you want to do with the data. If you are wanting to only return one month at a time (for example, the user provides a month and you return all the records for the month), then you could query the table, order by Transactions DESC, and put this into a temporary table that has a auto increment. Then you could SELECT the temp table, and the increment would give you the number you are after.

Hope this helps.
Apr 6 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
3727
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for...
35
7237
by: Traci | last post by:
If I have a table with an autonumber primary key and 100 records and I delete the last 50 records, the next record added would have a primary key of 101. Is there any way to have the primary key...
16
20435
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number...
1
1838
by: Knut B. | last post by:
I have a problem with a database of concerts, where I recently tried to change the existing database with some new rows/categories and some new names on a few of the existing ones. I have an id...
8
2531
by: luanhoxung | last post by:
hi all! i want to create group text for showing my invoice number. the invoice no. is created by 3 parts. 1st part: autonumber increasing at each new record. 2nd part: 2 characters of current...
9
11207
by: Tom_F | last post by:
To comp.databases.ms-access -- I just discovered, to my more than mild dismay, that some tables in my Microsoft Access 2003 database have duplicate numbers in the "AutoNumber" field. (Field...
1
1959
by: OxfordConsult | last post by:
Hello, I have created a form that links with a table with the autonumber feature as its primary key. Whenever i create a new record in the form (using a command button ... i have disabled the...
5
3170
by: troy_lee | last post by:
I have a table that has a PK field with the following format: Dyymm123. So that, a typical number might look like this D0806270. The first character is literal and never changes. The next four...
2
1773
by: Tyler | last post by:
I have a table where some of the entries have been deleted so the primary key field which is set as an autonumber field is not contiguous. When I try to ad a new record it starts numbering lower...
0
6974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7146
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7183
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.