Query

  • Thread starter Pass-the-Reality
  • Start date
P

Pass-the-Reality

In my query, I wanted to create a row that autonumbers each line. Example of
current out put is

Adam 4-3-09
Bob 4-3-09
Carrie 4-3-09

I want my query to produce the below.

1 Adam 4-3-09
2 Bob 4-3-09
3 Carrie 4-3-09
 
K

KARL DEWEY

Try this --
SELECT Q.[FullName], Q.[SomeDate], (SELECT COUNT(*) FROM [YourTable] Q1
WHERE Q1.[FullName]&Q1.[SomeDate] <= Q.[FullName]&Q.[SomeDate])+1 AS
Row, Q.[FullName], Q.[SomeDate]
FROM YourTable AS Q
ORDER BY Q.[FullName], Q.[SomeDate];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top