Glenda-- In the post I sent a few minutes ago, for things to work properly, the subquery 'sqryCADDR' in step 1 should read: SELECT personID, Max(caddrID) AS MaxOfcaddrID FROM CADDR GROUP BY personID, caddrType HAVING caddrType="email" My apologies... --Jim -----Original Message----- From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf Of Jim Pettit Sent: Monday, March 07, 2005 6:21 AM To: mso@xxxxxxxxxxxxx Subject: [mso] Re: SQL in Access :VSMail mx1 Glenda-- In this situation -- as in most others -- there is more than one way to arrive at a solution. Since I can't cover them all, I'll tell you what I would do: 1) Create and save a subquery which we'll call sqryCADDR, using the following SQL: SELECT personID, Max(caddrID) FROM CADDR GROUP BY personID, caddrType HAVING caddrType="email" 2) Create and save a main query (calling it whatever you want) using the following SQL: SELECT sqryCADDR.personID, caddrNmbr FROM sqryCADDR INNER JOIN CADDR ON sqryCADDR.MaxOfcaddrID = CADDR.caddrID Running that second query will return the name and email address with the highest caddrID for each person with an email address. To use it in a form or report, just do your normal Access magic. Hope this helps. --Jim -----Original Message----- From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf Of Glenda Wells Sent: Monday, March 07, 2005 5:45 AM To: Glenda Wells; mso@xxxxxxxxxxxxx Subject: [mso] Re: SQL in Access :VSMail mx1 I'm still not getting quite what I want. The result from the SQL is the one record with the max caddrID.=20 What I'm supposed to get is the caddrNmbr with the max caddrID per personID where the caddrType is email. =20 I've tried many combinations but haven't been able to make any further headway. I'm t-h-i-i-s close but not seeing it. ************************************************************* You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or MicrosoftOffice@xxxxxxxxxxxxxxxx To send mail to the group, simply address it to mso@xxxxxxxxxxxxx To Unsubscribe from this group, send an email to mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in the subject line. Or, visit the group's homepage and use the dropdown menu. This will also allow you to change your email settings to digest or vacation (no mail). //www.freelists.org/webpage/mso To be able to use the files section for sharing files with the group, send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with instructions. Once you are a member of the files group, you can go here to upload/download files: http://www.smartgroups.com/vault/msofiles ************************************************************* ************************************************************* You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or MicrosoftOffice@xxxxxxxxxxxxxxxx To send mail to the group, simply address it to mso@xxxxxxxxxxxxx To Unsubscribe from this group, send an email to mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in the subject line. Or, visit the group's homepage and use the dropdown menu. This will also allow you to change your email settings to digest or vacation (no mail). //www.freelists.org/webpage/mso To be able to use the files section for sharing files with the group, send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with instructions. Once you are a member of the files group, you can go here to upload/download files: http://www.smartgroups.com/vault/msofiles *************************************************************