From: QB on 5 Feb 2010 15:07 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.
From: KARL DEWEY on 5 Feb 2010 15:46 Try this -- SELECT TOP 1 first_name, last_name, email FROM tbl_contacts GROUP BY first_name, last_name, email ORDER BY Len([email]) DESC; -- Build a little, test a little. "QB" wrote: > 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.
|
Pages: 1 Prev: I need to add data to a table from another table how do I acheive Next: group query |