Posted to microsoft.public.excel.worksheet.functions
|
|
Revisit an older post, looking for SQL help on adding range datafrom many sheets to a single sheet
On May 31, 2:29*pm, wrote:
On 31 May, 15:03, Rick wrote:
This post answers the question, but I can't figure out how to apply
the model displayed to my scenario.
http://groups.google.com/group/micro...orksheet.funct...
I created named ranges, and get to the point of: "Replace the
displayed SQL code with an adapted version of this:",
Now, all bets are off.
My named ranges on the 4 worksheets a
BG
Chicago
Lisle
Schaumburg
This is the code that appears in the SQL query window:
SELECT BG.`Most Recent Employer`, BG.`Start Date`, BG.`Last Name`,
BG.`First Name`, BG.Title, BG.`Previous Employer`, BG.Title1,
BG.`Email Address`, BG.`BBB Office`, BG.Consultant
FROM BG BG
ORDER BY BG.`Most Recent Employer`
How do I create as the author describes as "an adaped version of
this"?
I'd like to get it to work. but how should the SQL code look with the
additional named ranges added? *Having trouble figuring out the
nomenclature.
Many thanks, for anyone who'd like to have a gander at this.
Rick
Rick,
Stripping it right back to the bare bones, this might get you started:
SELECT *
FROM BG
Union All
SELECT *
FROM Chicago
Union All
SELECT *
FROM Lisle
Union All
SELECT *
FROM Schaumburg
I always add a "Source" column to show where the original data came
from. *The SQL for this would look like:
SELECT *, 'BG' as Source
FROM BG
Union All
SELECT *, 'Chicago' as Source
FROM Chicago
Union All
SELECT *, 'Lisle' as Source
FROM Lisle
Union All
SELECT *, 'Schaumburg' as Source
FROM Schaumburg
Hope this helps.
Ian-
ian:
That worked just wonderfully!
Thank you so much.
Rick.
Now it's time to brush up on my SQL.
|