Avatar of Lulu0
Lulu0
Flag for United States of America asked on

Append string value to table name

How do I get the value from "purchasing" table (assume that value is 1001) and make a new table called "sales" having that retrieved value after it, such as "sales1001"?

I've started....
sql = "SELECT max(transaction_id) as maxT INTO temp FROM purchasing; "
db.Execute sql
DoEvents

...and to make the new table...
sql2 = "SELECT cust_id, prod_id, qty INTO sales  <--how do I append the value 1001 here?
from cust_inv
db.Execute sql2
DoEvents
Microsoft Access

Avatar of undefined
Last Comment
OP_Zaharin

8/22/2022 - Mon
SOLUTION
GlobaLevel

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
ALaRiva

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
OP_Zaharin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy