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 add a column to an existing record?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tamerelrefaie - 16 Jul 2007 16:14 GMT
I've made a union query and I want to add now a column to this query
Beside I want it to get the table name beside each record because these
records belongs to different tables as I said in the begining it's a union
query.

example
table1
table2
table3

union query xyz containing all data in these three tables.

I want to add a column to this query and in this column, i want it to
contain infront of each record the name of the table from which it come from.

please really need your help.
KARL DEWEY - 16 Jul 2007 16:34 GMT
Add the following to each select statement in the union query ---
        ,  "YourTableName" AS [TableName]
Signature

KARL DEWEY
Build a little - Test a little

> I've made a union query and I want to add now a column to this query
> Beside I want it to get the table name beside each record because these
[quoted text clipped - 12 lines]
>
> please really need your help.
tamerelrefaie - 16 Jul 2007 17:06 GMT
Really thanks alot Karl

> Add the following to each select statement in the union query ---
>          ,  "YourTableName" AS [TableName]
[quoted text clipped - 15 lines]
> >
> > please really need your help.
Douglas J. Steele - 16 Jul 2007 16:35 GMT
SELECT Field1, FIeld2, "Table1" As DataSource
FROM Table1
UNION
SELECT Field1, FIeld2, "Table2"
FROM Table2
UNION
SELECT Field1, FIeld2, "Table3"
FROM Table3

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> I've made a union query and I want to add now a column to this query
> Beside I want it to get the table name beside each record because these
[quoted text clipped - 13 lines]
>
> please really need your help.
tamerelrefaie - 16 Jul 2007 17:06 GMT
Really thanks alot Douglas

> SELECT Field1, FIeld2, "Table1" As DataSource
> FROM Table1
[quoted text clipped - 22 lines]
> >
> > please really need your help.
 
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.