Linking Queries?

  • Thread starter Thread starter tina
  • Start date Start date
T

tina

i modeled your setup, as
table CustomerPhoneNumbers
CustomerPhoneNumber

table PhoneCalls
PhoneNumber
NumberOfCalls

here's a SQL statement that should work, after you put in
the correct table and field names from your db:

SELECT CustomerPhoneNumbers.CustPhoneNumber, Nz
([NumberOfCalls],0) AS CallCount
FROM CustomerPhoneNumbers LEFT JOIN PhoneCalls ON
CustomerPhoneNumbers.CustPhoneNumber =
PhoneCalls.PhoneNumber;

hth
 
Thank you very much..I will try this first thing tomorrow when I get
to work!

Scott

Newsgroups: microsoft.public.access.queries
Subject: Linking Queries?
From: "tina" <[email protected]>

i modeled your setup, as
table CustomerPhoneNumbers
CustomerPhoneNumber

table PhoneCalls
PhoneNumber
NumberOfCalls

here's a SQL statement that should work, after you put in
the correct table and field names from your db:

SELECT CustomerPhoneNumbers.CustPhoneNumber, Nz
([NumberOfCalls],0) AS CallCount
FROM CustomerPhoneNumbers LEFT JOIN PhoneCalls ON
CustomerPhoneNumbers.CustPhoneNumber =
PhoneCalls.PhoneNumber;

hth
-----Original Message-----
I have been playing around with linking queries and I cant seem to
figure out how to do what I need.

I have 2 tables...

1st table has phone #'s and call counts to that phone #
2nd table has every phone # on the customer's account.

I start a new query and I link them by phone #

I need the query to show all the phone #'s from the customers account
and which ones had call counts...Numbers that do not show on the 1st
table should show up as 0 for the call count.

example

table 1
4133333333 6 calls
4132222222 10 calls
4136666666 5 calls

table 2
4133333333
4132222222
4136666666
4139999999
4138888888
4134544667

so they query would show
4133333333 6
4132222222 10
4136666666 5
4139999999 0
4138888888 0
4134544667 0

Any help would be great

Scott
.
 
Back
Top