Tekime
Registered User.
- Local time
- Today, 18:02
- Joined
- Jun 26, 2003
- Messages
- 72
I'm having a real tough time with this query I'm trying to create. I need to retreive transactions which are not related to a specific chargeback, but are related to a specific credit card number.
tbl_Transactions stores all of the transactions. Each transaction record has an orderId with a corresponding record in tbl_Orders
tbl_Chargebacks_Transactions stores all related chargeback IDs and transaction IDs.
tbl_Orders stores customer order info, including credit card number
I need to select data from tbl_Transactions where the following criteria are met:
The transactionId cannot have a record in tbl_Chargebacks_Transactions where the related chargebackId is equal to a pre-defined number. But, the transactionId can exist in tbl_Chargebacks_Transactions where the chargebackId is not equal to this pre-defined number.
The transaction must be on a pre-defined credit card number.
For example, say I know the ccNumber is 1111222233334444 and the chargebackId is 135. I need a list of all transactions which do not have an entry in tbl_Chargebacks_Transactions with a chargebackId of 135, and which do have an orderId specified in tbl_Transactions where the orderId has a ccNumber field equal to 1111222233334444.
I hope this makes some sense, I cannot figure out how to get this one right.
Thank you very much for any help with this one
tbl_Transactions stores all of the transactions. Each transaction record has an orderId with a corresponding record in tbl_Orders
tbl_Chargebacks_Transactions stores all related chargeback IDs and transaction IDs.
tbl_Orders stores customer order info, including credit card number
I need to select data from tbl_Transactions where the following criteria are met:
The transactionId cannot have a record in tbl_Chargebacks_Transactions where the related chargebackId is equal to a pre-defined number. But, the transactionId can exist in tbl_Chargebacks_Transactions where the chargebackId is not equal to this pre-defined number.
The transaction must be on a pre-defined credit card number.
For example, say I know the ccNumber is 1111222233334444 and the chargebackId is 135. I need a list of all transactions which do not have an entry in tbl_Chargebacks_Transactions with a chargebackId of 135, and which do have an orderId specified in tbl_Transactions where the orderId has a ccNumber field equal to 1111222233334444.
I hope this makes some sense, I cannot figure out how to get this one right.
Thank you very much for any help with this one