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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select INTO table "dynamic"

Status
Not open for further replies.
Nov 29, 2002
64
0
0
US
Hello everyone, is it possible with SQL (select into) to generate a table with dynamic names?

Example: Select COL01, COL02, COL03 INTO TABLE_"DATE" FROM TABLE01

where Table_"date" will be a table like TABLE_07112005, tomorrow it will be like TABLE_07122005, etc..

Cheers,
Alfredo
 
dim sqlstr
sqlstr = "Select COL01, COL02, COL03 INTO TABLE_" & format(DATE(),'mmddyyyy') & " FROM TABLE01"
currentdb.execute strsql, dbfailonerror
 
Thanks for your fast response lupins46!! I thought about something like that, but I was trying not to use vb, is it there any other way with just SQL?
cheers,
Alfredo
 
No.

You cannot use expressions for table names in the Access query processor.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top