Adding sequence number to a query

Tony1258

Registered User.
Local time
Today, 16:29
Joined
Jun 8, 2006
Messages
29
I have a query that captures date values from a table based on a between function that works fine. What I would like to do is associate a sequence number fro each date value returned and either perform a make table or leave it as a select query. If I create a table I know that I aam able to add an autonumber field but the query is executed frequently and performing the addition of the autonumber field is not feesible. Any thoughts how I can generate the sequence number each time the query is executed?

Thanks
 
Here's a SQL suggestion, only considering the date and ranking
Code:
SELECT t.myDate, (
    SELECT Count(*)
    FROM myTable s
    WHERE t.myDate <= s.myDate) as myRank
FROM myTable t
 

Users who are viewing this thread

Back
Top Bottom