SQL Stmt to Copy Query Results to Table - Append Existing Table - Microsoft Community


hello,

 

i have query performs actions/calculations existing data import table. after import, these tables need cleared next day’s import run (already have setup , works super). however, i’m looking add query data existing master table continues collect , not delete – continues append after each upload.  i tried adjust below sql statement, doesn’t work.

 

below query , table names along fields in each (has same exact field columns).

 

any thoughts on how achieve this?

 

thanks – jenny b.

 

 

 

query = b55m query - (includes fields: header record, account number, issue)

 

table =master - (includes fields: header record, account number, issue)

 

database = daily import files.accdb

 

 

 

sub insertintox1()

 

    dim dbs database

   

    set dbs = opendatabase("daily import files.mdb")

   

    dbs.execute " insert master " _

        & "select * " _

        & "from [b55m query];"

        

    dbs.close

 

end sub

what's meaning of "doesn't work"? happens when run - nothing, error message, smoke coming out of cooling fans?

i'd inclined explicitly name fields rather select *:

insert master ([header record], [account number], [issue]) 

select [header record], [account number], [issue] [bssm query];



Office / Access / Windows 10 / Office 2010



Comments

Popular posts from this blog

Getting ErrorCode: 120018 when trying to access Microsoft account - Microsoft Community

The message was sent to a distribution list ‎(DL)‎ - Microsoft Community

Activation Error 0x8004FE93 - Microsoft Community