tkaplan
12-01-2005, 10:26 AM
I have a table that has visit dates and center numbers. the combination of the 2 fields is the primary key.
i need to write a query that numbers the visits in order so that i can query on all of the 1st visits, or all of the 2nd visits, etc. there is an unlimited number of visits possible.
so in my table if i have:
DATE.......CENTER
1/1/05.....centerA
2/4/05.....centerB
6/5/05.....centerA
4/3/05.....centerA
my query should produce:
DATE.......CENTER....VISIT
1/1/05.....centerA.....1
2/4/05.....centerB.....1
6/5/05.....centerA.....3
4/3/05.....centerA.....2
is there a function that already exists, or can anyone assist me in writing such a function???
Thank you.
i need to write a query that numbers the visits in order so that i can query on all of the 1st visits, or all of the 2nd visits, etc. there is an unlimited number of visits possible.
so in my table if i have:
DATE.......CENTER
1/1/05.....centerA
2/4/05.....centerB
6/5/05.....centerA
4/3/05.....centerA
my query should produce:
DATE.......CENTER....VISIT
1/1/05.....centerA.....1
2/4/05.....centerB.....1
6/5/05.....centerA.....3
4/3/05.....centerA.....2
is there a function that already exists, or can anyone assist me in writing such a function???
Thank you.