Find Missing Number in Sequence per Record

escuro19

New member
Local time
Today, 23:33
Joined
Oct 30, 2009
Messages
5
Hello,

I created a table where each Volunteer start from Day 1 to n...(Sequence)for example:

Volunteer Day
1 1
1 2
1 3
1 4
2 1
2 2
2 3
3 1
3 2

I am hoping if somone could help, i want to be able to loop through a Volunteer' Day, to find missing sequence. eg. the user specify which Volunteer they want to see (using Textbox) then it will bring up just that volunteer and the missing sequence:

Volunteer Day Error
1 1 ok
1 2 ok
1 4 Error
1 5 ok

If possible output it in a datasheet (table).

Thankyou in advance
 
No need to loop, just query...
Make a query to calculate either the next or previous in sequence...
Select Volunteer, DayNumber ** + 1 as NextDay
From yourtable

Now make a new query to join above query with yoru table and find any "unmatched"

Done...

** Day is a reserved word as is Error, please dont use reserved words in field names or variables... This will cause problems.
 

Users who are viewing this thread

Back
Top Bottom