Comparing values in same field to return only the first unique val

G

Guest

Not sure how I would need to create this and haven't come across the answer
in my searches or help in access. I would like to thank anyone who can
assist me on this one, my brain has just about given up on this!

What I need to do is take the first value found in the field (say ticket
number) and compare the next value to make sure that it is a different
number. If it is the same number I want to make it not display any of the
next values until it finds something different.


Example:

TicketNo Time
2 8:00am
2 8:30am
2 4:00pm
3 11:00am
4 4:30pm
4 5:00pm
5 10:30am

and I need the query to return

2 8:00am
3 11:00am
4 4:30pm
5 10:30am

Hope you guys can help me out on this one!
 
M

Michel Walsh

Hi,




SELECT TicketNo, MIN(time)
FROM myTable
GROUP BY TicketNo





Hoping it may help,
Vanderghast, Access MVP
 

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