diktyo 0 Posted December 13, 2023 Hi, The title is cheesy but so is my situation. I have an SQLServer database and from the tables Customer and Item I get with two queries the datasets I need (for Customer the fields are CustID, CustCode and for Item they are ItemID, ItemCode, where the IDs are the relevant Record Numbers). I also have an excel file which contains pairs of CustCode and ItemCode with a third field of Discount for each pair. So a customer can have e.g. ten lines with his CustCode and in each line a different ItemCode with the relevant Discount. I read this excel file into a table (I use UniDAC) which of course is not part of the database with two extra fields for CustID and ItemID (empty). I must fill the CustID and ItemID for each pair using the results of the first two queries (this is not negotiable!). If the third table was part of the database it would be "fairly easy" with a query and joins. But now I am at a loss. Any advice on actions would be appreciated. Thanks, Petros Share this post Link to post
Lajos Juhász 295 Posted December 13, 2023 Open a second connection to the database and fill the required fields. Here locate is your friend. Share this post Link to post