Good morning,
I am reasonably new to SQL and I have written a simple union query to pull data from 4 tables in 1 database as per below.
But is there anyway I can do a union from 2 different databases as they each hold different months data.
I understand how to do this in VBA where I would use a source file etc.. but I haven't attempted this in SQL, all the columns etc.. will be the same as I am going from a weekly basis to a monthly
I currently refresh this data via going PowerPivot, Design - Table Properties and SAVE.
This is where I would update everything going forward as well.
thanks in advance
Gavin
I am reasonably new to SQL and I have written a simple union query to pull data from 4 tables in 1 database as per below.
But is there anyway I can do a union from 2 different databases as they each hold different months data.
I understand how to do this in VBA where I would use a source file etc.. but I haven't attempted this in SQL, all the columns etc.. will be the same as I am going from a weekly basis to a monthly
I currently refresh this data via going PowerPivot, Design - Table Properties and SAVE.
This is where I would update everything going forward as well.
Code:
SELECT week_20_51.field1, 20_51.field2, 20_51.field3
FROM 20_51
UNION ALL SELECT 20_52.field1, 20_52.field2, week_20_52.field3
FROM week_20_52
thanks in advance
Gavin