foxtrot123
Registered User.
- Local time
- Today, 13:54
- Joined
- Feb 18, 2010
- Messages
- 57
I have data like so:
And need to return a running count for the number of visits per subject, so:
I'd like to use DCount and have tried all variations of the following, but none of them returns the correct number:
VisitNumber: DCount("*","mytable","VisitID >= " & [VisitID] & " AND SubjectID =" & [SubjectID])
Suggestions?
Code:
SubjectID VisitID
1 5
1 5
2 7
2 7
2 9
2 9
etc
Code:
SubjectID VisitID VisitCount
1 5 1
1 5 1
2 7 1
2 7 1
2 9 2
2 9 2
etc.
VisitNumber: DCount("*","mytable","VisitID >= " & [VisitID] & " AND SubjectID =" & [SubjectID])
Suggestions?