how to make a query using SQL to get customer info by typing telep

C

colladita

how to make a query using SQL to get customer info by just entering the
telephone number?
 
J

John Vinson

how to make a query using SQL to get customer info by just entering the
telephone number?

Well, of course, the SQL will depend totally on the structure of your
table, and what customer info you want. In short, assuming that the
telephone number is just a field named Phone in the table named
Customers:

SELECT * FROM Customers WHERE Phone = [Enter phone number:];

John W. Vinson[MVP]
 
C

colladita

Thank you John:
This is my first time creating a database,:)
your post help me a lot, but gave me all customers records, not only the one
that I'm asking about. The idea is to only get the customer record where the
telephone number matches.
Any hint?
Thank you again


John Vinson said:
how to make a query using SQL to get customer info by just entering the
telephone number?

Well, of course, the SQL will depend totally on the structure of your
table, and what customer info you want. In short, assuming that the
telephone number is just a field named Phone in the table named
Customers:

SELECT * FROM Customers WHERE Phone = [Enter phone number:];

John W. Vinson[MVP]
 
R

Rick Brandt

colladita said:
Thank you John:
This is my first time creating a database,:)
your post help me a lot, but gave me all customers records, not only
the one that I'm asking about. The idea is to only get the customer
record where the telephone number matches.
Any hint?

John's example query includes a parameter that should prompt you for a specific
phone number when you run it. If you enter a particular customer's phone number
then that is the only record the query should return.
 
C

colladita

Thank you both, I realize what the problem was( some error in table's field
name) so now the queryis working fine
:)
 
Top