Senin, 03 Oktober 2011

[MS_AccessPros] left join: how to select one record

 

 Hi there -
Working on a drop down combo box for tenants on a work order form.
 
At the moment I am getting multiple records when a tenant has more than one phone number
 
How would I filter or change the sql to get only the first record. Thanks Michael
 
strSource = " SELECT tblPOC.PocID, [tblPOC].[FName] & "" "" & [tblPOC].[LName] & "", "" & [tblPhone].[PhoneNum] AS TenInfo, tblPocGroupLink.GroupID, tblPOC.Active" & _
            " FROM (tblPOC LEFT JOIN tblPhone ON tblPOC.PocID = tblPhone.PocID) INNER JOIN tblPocGroupLink ON tblPOC.PocID = tblPocGroupLink.PocID" & _
            " WHERE (tblPocGroupLink.GroupID) = " & Me.cmboClient & _
            " ORDER BY [tblPOC].[FName]"
Me.cmboTenantID.RowSource = strSource
Me.cmboTenantID = Null

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar