[AccessD] Query Help

Bryan Carbonnell carbonnb at gmail.com
Fri Mar 23 14:18:43 CDT 2012


Thanks gents,

That appears to be exactly what it is.

The dumb thing is that my boss is one of those duplicate entries. She
works out of 2 locations and has 2 phonebook entries.

Doh! Like I said, it's been a while :(

B

On Fri, Mar 23, 2012 at 3:07 PM, jwcolby <jwcolby at colbyconsulting.com> wrote:
> It does sound that way.
>
> John W. Colby
> Colby Consulting
>
> Reality is what refuses to go away
> when you do not believe in it
>
>
> On 3/23/2012 2:41 PM, Kaup, Chester wrote:
>>
>> Seems to me like the same LastName and FirstName exist more than once in
>> the table tblPhoneBook
>>
>> -----Original Message-----
>> From: accessd-bounces at databaseadvisors.com
>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell
>> Sent: Friday, March 23, 2012 1:34 PM
>> To: Access Developers discussion and problem solving
>> Subject: [AccessD] Query Help
>>
>> Hey guys I need help!
>>
>> It's been about 3 years since I have touched Access and can't recall
>> how to build a specific query.
>>
>> Here is what I have:
>>
>> tblUsers
>> ------------
>> ID - Autogenerated PK
>> LastName
>> FirstName
>> .....
>>
>> tblPhoneBook
>> --------------------
>> ID - Autogenerated PK
>> LastName
>> FirstName
>> Location
>>
>>
>> What I need is a query that will give me EVERYONE from tblUsers and
>> the matching records from tblPhoneBook. The only fields that are
>> common are the LastName and FirstName fields.
>>
>> This is the SQL that I've got and it's not working correctly, or at
>> least not to me anyway
>>
>> SELECT tblUsers.*, tblPhoneBook.[LastName], PhoneBook.[FirstName],
>> PhoneBook.Location
>> FROM tblUsers LEFT JOIN PhoneBook ON (tblUsers.FirstName =
>> PhoneBook.[FirstName]) AND (tblUsers.LastName = PhoneBook.[LastName])
>> ORDER BY tblUsers.LastName;
>>
>> tblUsers has 987 records and the query is returning 993 records and I
>> can't for the life of me figure it out.
>>
>> These tables were actually Excel Spreadsheets that were imported into
>> Access.
>>
>> Help!! Please?!?!
>>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com



-- 
Bryan Carbonnell - carbonnb at gmail.com
Life's journey is not to arrive at the grave safely in a well
preserved body, but rather to skid in sideways, totally worn out,
shouting "What a great ride!"


More information about the AccessD mailing list