I am not sure how to modify this SQL to get the same results when I try to substitute the field "Name" with two fields "FirstName" and "LastName"
Code:
SELECT t1.Name, t1.Title, t1.Address, t1.City, t1.State, t1.ZipCode, t1.[Contact Number], t1.Email, t1.Organization, t1.[Date Received]
FROM Orders AS t1
WHERE (((t1.Organization)=[Forms]![frmProducts]![cboOrganization]) AND ((t1.[Date Received])=(SELECT Max(t2.[Date Received]) FROM Orders t2 WHERE t2.Name=t1.Name GROUP BY t2.Name)));
I have an SQL that basically selects a bunch of fields from the Orders table where the selection in the form's combo box "Organization" equals the Organization name in the Orders table. It is grabbing the most recent contact information of all personnel that worked at that organization based on their latest order date. It auto-populates the form with this information. This SQL is on the Row Source of Names combo box on the products form.
It works fine but I have decided to split the name field out into two fields, FirstName and LastName. How can I group by these two fields which would have to probably be concatenated together to get the correct results. Thus the t1.Name would have to substituted with "t1.FirstName & t1.LastName" and the same for t2.Name in the SQL statement above.
Suggestions from Access guru gods?
Using Access 2010