Jay, Ernie,
The bigger picture is...
I am looking at the email messages saved in 7 Outlook folders named "DONE
xxxx" etc.. I mentioned 3 only as an example because if I can do it for 3, I
can do it for 7.
In MS-Access, I have created linked tables of data from these Outlook
folders via Insert --> Table --> Link Table, and then selecting
Exchange()...
What I want to do next is, pull selected columns (From, Received) into Excel
vis a MS-Query on Excel. However before I do this, I need to add a column so
I can distinguish the 7 folders from each other -- Hence the "Category"
column I wish to add.
To add the "Category" column, I though the best way was to create a query
which pulls 1 table, adds the Category column with a fixed value, appends
the next one in the same way,.... .. until the 7 tables are joined in one
Query.
My Excel sheet would link to this query, and provide live stats on how many
emails were received each day in each category.
This was the simplest method I could think of. If there is a simpler method,
I would appreciate it.
Once I have done the above, I'll edit my Excel query to somehow append only
the new data as the Outlook folders get bigger.
Regards.
Android.
Jay Vinton said:
SELECT 'Confirmations' AS Category, [DONE confirmations].From AS [From],
[DONE confirmations].Received AS Received
FROM [DONE confirmations]
Your query shouldn't run. You should get a circular reference error
because you have 2 aliases that are the same as the column names, and a
general SELECT error because "From" is a reserved word in SQL and
shouldn't/can't be used as a column name.
I think you should review your design. Why not have one table with a
column that indicates the status (confirmation, repeat, etc.)? It would help
if we had more info about the bigger picture.