Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

import table based on begining of file name

Status
Not open for further replies.

MICKI0220

IS-IT--Management
Jul 20, 2004
337
US
I need to import a temporary table. In sql 2008 I have a database temporary table that is made. The name of the table changes based on the date. The name of the table becomes a combination of the name of the report + the name of the user who was signed in + the date it was run.....so everything will remain the same other than the date....I am creating a report in Access that needs information from this temporary table but I don't want to manual create the table every week. the name of the table will look like this

dbo.tempCertifiedPR_bgearheart_090711_113431

I can have everything up until the _090711_113431 stay the same.

Any suggestion would be great.

Micki
 
You can create a pass-through to the SQL database with a SQL statement like:
Code:
SP_TABLES 'tempCertifiedPR_bgearheart%'
This will return all table names beginning with the string. I would use a little code to change the SQL property of a saved pass-through query to select from the table from the previous p-t.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top