how to get the table name in a query?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want a query that can get me the table name that I'm querying on it

can I do this?
 
If this is in reference to your previous question, the answer is just as
Karl gave it. You must explicitly name the table. There's no "automatic"
way to do it. It would look something like this:

SELECT "table1" As TableName, * FROM Table1
Union
SELECT "table2"As TableName, * FROM Table2
UNION
SELECT "table3"As TableName, * FROM Table3;

As a side note, if you want specific answers, it would be better to ask
specific questions, listing the actual table and field names that you're
using. It will avoid a lot of confusion and folks will be more willing to
look at your questions.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top