Tekime
Registered User.
- Local time
- Today, 18:01
- Joined
- Jun 26, 2003
- Messages
- 72
Hi all,
I'm trying to get an updateable recordset using a complex query involving many joins, but I'm running into some problems. I'll explain what the database is for and a bit about how it is designed to give you an idea of what's going on. I would appreciate any help with this
The database is for processing chargebacks on my company's merchant account. For those of you unfamiliar with the term, a chargeback is a dispute from a merchant account provider (credit card company) on behalf of their customer. We receive a chargeback that specifies the card number the charges were on, as well as all transactions that chargeback is disputing.
Every day we will import orders and transactions into respective tables (tbl_Orders and tbl_Transactions) from our order manager. When we receive a chargeback, we need to associate all disputed transactions in tbl_Transactions with the chargeback record we create in tbl_Chargebacks; since this is a many-to-many relationship I have a table called tbl_Chargebacks_Transactions (fairly self-descriptive).
Here is a screenie of a chunk of the database schema so you can see the relationship between chargebacks and orders:
http://www.fury-tech.com/showimage.php?image=/images/user/Tekime/CbOrd_Rel01.gif
This works fine for the most part. Although, since the only relationship between chargebacks and orders is the Chargebacks_Transactions and Transactions tables, which can possess numerous records for one chargeback, if I need a field from the order table in a complex query based on the chargebackId, it will return multiple records if there are multiple entries in Chargebacks_Transactions.
Okay, so I can use DISTINCTROW and this works fine in limiting the records. Except, I can't get an updateable recordset this way!
I can use a bound subform which allows me to update records, but I cannot search the fields in that subform to find records in the parent form. (Say I want to search for chargebacks by credit card number, well, the ccnumber is in the orders table).
Here is my (half finished) Chargeback Details form:
http://www.fury-tech.com/showimage.php?image=/images/user/Tekime/CbDetails.png
I'm not sure if there is a way to construct my query so I can retrieve all of the fields present on this details form and be able to update them as well, but this is my goal.
If I can't reqrite the query to fit my schema, I believe I can create an additional relationship between chargebacks and orders by storing an orderId in the chargebacks table. This is repetitious however, since I can find the orderId based on the transactions, but so far it's not fitting my needs.
I hope this makes SOME sense to you, and if so, I hope you can throw me an idea on making this work.
Thanks kindly.
I'm trying to get an updateable recordset using a complex query involving many joins, but I'm running into some problems. I'll explain what the database is for and a bit about how it is designed to give you an idea of what's going on. I would appreciate any help with this
The database is for processing chargebacks on my company's merchant account. For those of you unfamiliar with the term, a chargeback is a dispute from a merchant account provider (credit card company) on behalf of their customer. We receive a chargeback that specifies the card number the charges were on, as well as all transactions that chargeback is disputing.
Every day we will import orders and transactions into respective tables (tbl_Orders and tbl_Transactions) from our order manager. When we receive a chargeback, we need to associate all disputed transactions in tbl_Transactions with the chargeback record we create in tbl_Chargebacks; since this is a many-to-many relationship I have a table called tbl_Chargebacks_Transactions (fairly self-descriptive).
Here is a screenie of a chunk of the database schema so you can see the relationship between chargebacks and orders:
http://www.fury-tech.com/showimage.php?image=/images/user/Tekime/CbOrd_Rel01.gif
This works fine for the most part. Although, since the only relationship between chargebacks and orders is the Chargebacks_Transactions and Transactions tables, which can possess numerous records for one chargeback, if I need a field from the order table in a complex query based on the chargebackId, it will return multiple records if there are multiple entries in Chargebacks_Transactions.
Okay, so I can use DISTINCTROW and this works fine in limiting the records. Except, I can't get an updateable recordset this way!
I can use a bound subform which allows me to update records, but I cannot search the fields in that subform to find records in the parent form. (Say I want to search for chargebacks by credit card number, well, the ccnumber is in the orders table).
Here is my (half finished) Chargeback Details form:
http://www.fury-tech.com/showimage.php?image=/images/user/Tekime/CbDetails.png
I'm not sure if there is a way to construct my query so I can retrieve all of the fields present on this details form and be able to update them as well, but this is my goal.
If I can't reqrite the query to fit my schema, I believe I can create an additional relationship between chargebacks and orders by storing an orderId in the chargebacks table. This is repetitious however, since I can find the orderId based on the transactions, but so far it's not fitting my needs.
I hope this makes SOME sense to you, and if so, I hope you can throw me an idea on making this work.
Thanks kindly.