LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default SQL query JOINED Data from which Table?

Hello All,

I am using a query to get data from two tables using UNION All.

How can I add a field to the joined data to show the data from which
table?

Something like For eg.

If I say select field1, field2, field 3 FROM Table1 Union all field1,
field2, field3 FROM Table2

Then can I add a field say field4 (which is not in either table) and
add "A" if the data is from Table1 and "B" if the data from Table2 ?

Thanks

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot table to query data in a set range adman4 Excel Discussion (Misc queries) 4 April 26th 10 08:01 PM
Data Points Joined by Spiral !! monir Charts and Charting in Excel 0 July 21st 07 10:16 PM
Pivot Table Data Field Query Pepikins Excel Worksheet Functions 1 June 14th 05 10:58 PM
Userform web Data query table alcorjr[_3_] Excel Programming 0 January 29th 04 06:49 PM
Append Data to Table after Web Query OmaSteak Excel Programming 0 January 29th 04 05:45 PM


All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"