Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / July 2007

Tip: Looking for answers? Try searching our database.

how to get the table name in a query?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tamerelrefaie - 16 Jul 2007 16:34 GMT
I want a query that can get me the table name that I'm querying on it

can I do this?
Roger Carlson - 16 Jul 2007 16:47 GMT
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.

Signature

--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

>I want a query that can get me the table name that I'm querying on it
>
> can I do this?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.