Record with longest entry

Q

QB

I know this may sound a little paculiar, but I need some help to write a
query that will list the record that has the longest entry (textual length -
Num chars) in a field.

I have a table - tbl_contacts
with 3 fields of interest - first_name, last_name, email

I need to extract the first_name and last_name for the record with the
longest email. How can I do this?

Thank you.
 
K

KARL DEWEY

Try this --
SELECT TOP 1 first_name, last_name, email
FROM tbl_contacts
GROUP BY first_name, last_name, email
ORDER BY Len() DESC;
 

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