I have multiple queries containing the same types of data.
How would I make one big query out of all of this data?
I have multiple queries containing the same types of data.
How would I make one big query out of all of this data?
If all the fields in your queries have the same fields [with the same data types] in the same order . . .
You can create a 'Union Query' that combines all the data into one data set.
What I do if I want to see ALL the data from all the queries in one data set:
I open each query in SQL View and copy the SQL into a new query and put 'UNION ALL' on a new line except after the last query.
It will look something like this:
Select Field1, Field2, field 3 From Table1 where . . .
UNION ALL
Select Field1, Field2, field 3 From Table2 where . . .
UNION ALL
Select Field1, Field2, field 3 From Table3 where . . .
UNION ALL
Select Field1, Field2, field 3 From Table4 where . . .;
The field names don't have to be the same - just the order and the type of data [because otherwise you might be attempting to put Text, Date and Currency [different types of data] in the same column of the query . . .
Let us know if you need more help!
OK that worked, however this is giving me another problem. I figure it must be down to this as I have eliminated everything else.If all the fields in your queries have the same fields [with the same data types] in the same order . . .
You can create a 'Union Query' that combines all the data into one data set.
What I do if I want to see ALL the data from all the queries in one data set:
I open each query in SQL View and copy the SQL into a new query and put 'UNION ALL' on a new line except after the last query.
It will look something like this:
Select Field1, Field2, field 3 From Table1 where . . .
UNION ALL
Select Field1, Field2, field 3 From Table2 where . . .
UNION ALL
Select Field1, Field2, field 3 From Table3 where . . .
UNION ALL
Select Field1, Field2, field 3 From Table4 where . . .;
The field names don't have to be the same - just the order and the type of data [because otherwise you might be attempting to put Text, Date and Currency [different types of data] in the same column of the query . . .
Let us know if you need more help!
When this produces a union table, I create a query from it.
So now I have a query of all of the date using the above code.
When I try to link this to excel, it says there are "too many parameters". Do you know how this could be?
I'm really sorry to incorrectly tarnish your great name.... I was wrong and your help that you gave me worked fine. It is a completley different slice of code that is buggering up the link to excel.
For every import from the csv files I made a query. At the end of each query I put : Filename: "NAME OF THE FILE" so it added an extra field naming the source. This is what is messing with the link. Does anyone know any way to fix this???
No problem . . . especially as I don't have a great name to tarnish!!
I'm still learning and I think the real gurus here know that!
It might be a good idea to mark this thread 'Solved' [Thread Tools . . . above] & start a new thread with your new issue.
There is a better chance that more people will look at your question if there are no replies.