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!

Relationship Help

Status
Not open for further replies.

hdgirl

Technical User
Feb 2, 2002
131
GB
Can anyone help me please.

I have 2 tables Customer & Transactions, i need to record the amount of times customers enter a lounge. Every customer that enters is a transaction, i want to record all transactions for all members so i have tried linking
Customer Transaction
RefNo (A/N & P/K) ID (Number & P/K)
MemberNumber Transaction Number
Etc Etc
I have a one to many relationship on RefNo & Transaction No
however not all customers are members some can be vouchers or day visitors.

I have tried this many ways & cannot get the results that i am trying to get. Desoerate guidance is needed on this


CJB
 
Is the link between the table

Customer.RefNo = Transaction.TransNo ?

If it is then try something like

Select C.MemberNumber, T.TransNo
From Customer As C INNER JOIN Transaction As T
ON C.RefNo = T.TransNo
WHERE NOT (C.MemberNumber IS NULL)

I'm assuming that the voucher and/or day visitor records have a NULL MemberNumber.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top