My Assistant
|
|
May 5 2012, 06:21 AM
Post
#1
|
|
|
New Member Posts: 2 |
Hi all
Need some help so hoping there's an easy answer. Background: I have a database from which I'm creating a temp database that's intended to be used to hold some temp tables while the data is used to build a master table that's re-imported back into the database. All this to avoid bloating of the actual database. I've managed to create the db and put in the base table and the first temp table. What I need to do now is have a query run that uses the temp table in the temp db update the base table in the temp db but execute from the "real" database. The update query, if I built it in the temp db would be: UPDATE tmp_tblDeckTaxes INNER JOIN tmp_tbldecktaxes_1 ON (tmp_tblDeckTaxes.Ent_ID = tmp_tbldecktaxes_1.Ent_ID) AND (tmp_tblDeckTaxes.Loc_ID = tmp_tbldecktaxes_1.Loc_ID) AND (tmp_tblDeckTaxes.Country = tmp_tbldecktaxes_1.Country) AND (tmp_tblDeckTaxes.Rpt_ID = tmp_tbldecktaxes_1.Rpt_ID) AND (tmp_tblDeckTaxes.Rule = tmp_tbldecktaxes_1.Rule) SET tmp_tblDeckTaxes.Tax1_Juris = [tmp_tbldecktaxes_1].[Tax1_Juris], tmp_tblDeckTaxes.Tax1_Name = [tmp_tbldecktaxes_1].[Tax1_Name], tmp_tblDeckTaxes.Tax1_Reg = [tmp_tbldecktaxes_1].[Tax1_Reg], tmp_tblDeckTaxes.Tax1_Tx = [tmp_tbldecktaxes_1].[Tax1_Tx], tmp_tblDeckTaxes.Tax1_Rate = [tmp_tbldecktaxes_1].[Tax1_Rate]; What I'm trying to do is something like the following but I don't know the syntax to get this to fly: UPDATE [C:\Users\RC02041\Desktop\ASWorkDisc1\T-Rx-v\TRxTemp.accdb].tmp_tblDeckTaxes_1 IN 'C:\Users\RC02041\Desktop\ASWorkDisc1\T-Rx-v\TRxTemp.accdb' INNER JOIN [C:\Users\RC02041\Desktop\ASWorkDisc1\T-Rx-v\TRxTemp.accdb].tmp_tblDeckTaxes ON (tmp_tblDeckTaxes1.Ent_ID = tblDeckTaxes.Ent_ID) AND (tmp_tblDeckTaxes1.Loc_ID = tblDeckTaxes.Loc_ID) AND (tmp_tblDeckTaxes1.Country = tblDeckTaxes.Country) AND (tmp_tblDeckTaxes1.Rpt_ID = tblDeckTaxes.Rpt_ID) AND (tmp_tblDeckTaxes1.Rule = tblDeckTaxes.Rule) SET tblDeckTaxes.Tax1_Juris = [tmp_tblDeckTaxes1].[Tax1_Juris], tblDeckTaxes.Tax1_Name = [tmp_tblDeckTaxes1].[Tax1_Name], tblDeckTaxes.Tax1_Reg = [tmp_tblDeckTaxes1].[Tax1_Reg], tblDeckTaxes.Tax1_Tx = [tmp_tblDeckTaxes1].[Tax1_Tx], tblDeckTaxes.Tax1_rate = [tmp_tblDeckTaxes1].[Tax1_rate] (This is in a loop so there could ultimatley be a lot of these temp tables and corresponding queries - hence the desire to do all this outside the main db). Any ideas?!? Thanks! Adrian |
|
|
|
a5tell Syntax For Triggering An Update Query In Another Database Using Tables In The Other Database May 5 2012, 06:21 AM
pere_de_chipstick I would imagine that specifying and creating a lin... May 5 2012, 08:32 AM
theDBguy Hi Adrian,
What version of Access are you using... May 5 2012, 09:48 AM
a5tell Woo hoo! It works!
Thanks for your h... May 5 2012, 12:03 PM
theDBguy Hi Adrian,
Bernie and I are happy to help. Good... May 5 2012, 12:48 PM![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th June 2013 - 06:32 PM |