Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 roles for my customer id causes problems

Status
Not open for further replies.

antonyx

Technical User
Jan 19, 2005
204
GB
ok i have an issue.

my user will enter customer details.. eg name phone.. and the primary key is customer id.

there are also job details, pickup address, no. of passengers.. etc.. and the primary key is job id.

assigning a job to a customer is done is this way.

job id
customer id

my problem is this however. the person booking the job is also a customer and will also be assigned to the job using the same method.

when i create a query however, i cant display both the customer name and the booker name in the same query as both use the customer id... is this clear enough..

basically i need a method that allows me to assign customers from the same table to the same job but as 2 roles.
 
Your query say:
WHERE person.[customer phone] = [Enter No:] AND person_1.[customer phone] = [Enter No:]

It should either say:
WHERE person.[customer phone] = [Enter No:] OR person_1.[customer phone] = [Enter No:]
or:
WHERE [Enter No:] IN (person.[customer phone], person_1.[customer phone])

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top