Hi All,
I'm new to this, so apologies if I'm asking silly questions, but I've looked and can't see a solution.
Setup is:- I import a daily csv , query (filter)the relevant columns into a temp table.
Headings: Date_actual, Company ,xxx,xxx,xxx,Price
data is : actual date, company 1-30, xxx,xxx,xxx, number value for each company
I've created a query
TRANSFORM First(Imported_Data.Price) AS FirstOfPrice
SELECT Imported_Data.Date_Actual
FROM Imported_Data
GROUP BY Imported_Data.Date_Actual
PIVOT Imported_Data.Company;
This creates a datasheet as I want
date_actual, company1, company 2 etc
2/1/2012,price for company 1, price for company 2 etc
I wish to append this to Table2 so that I end up with a history of Prices per company over a year.
ie
2/1/2012,price for company 1, price for company 2 ..... comp30
3/1/2012,price for company 1, price for company 2 ..... comp30
4/1/2012,price for company 1, price for company 2 ..... comp30
5/1/2012,price for company 1, price for company 2 ..... comp30
My Table 2 is setup with ID, Date_actual, Comp1, comp2..... comp30
Whilst my query works on its own, as soon as I try to append it , It changes my query to
INSERT INTO History ( Date_Actual )
SELECT Imported_Data.Date_Actual
FROM Imported_Data
GROUP BY Imported_Data.Date_Actual;
and doesn't work. i've tried merging the 2 but get syntax errors... ..always hated syntax issues, I know what I want but a missing comma/bracket thwarts me .
:banghead:
I'm sure its something simple ..been a long day and probably shouldn't have had the 2nd glass of wine before deciding to look at this but I'm grabbing moments when I can .
Hope it makes sense and thanks in advance
El-d
I'm new to this, so apologies if I'm asking silly questions, but I've looked and can't see a solution.
Setup is:- I import a daily csv , query (filter)the relevant columns into a temp table.
Headings: Date_actual, Company ,xxx,xxx,xxx,Price
data is : actual date, company 1-30, xxx,xxx,xxx, number value for each company
I've created a query
TRANSFORM First(Imported_Data.Price) AS FirstOfPrice
SELECT Imported_Data.Date_Actual
FROM Imported_Data
GROUP BY Imported_Data.Date_Actual
PIVOT Imported_Data.Company;
This creates a datasheet as I want
date_actual, company1, company 2 etc
2/1/2012,price for company 1, price for company 2 etc
I wish to append this to Table2 so that I end up with a history of Prices per company over a year.
ie
2/1/2012,price for company 1, price for company 2 ..... comp30
3/1/2012,price for company 1, price for company 2 ..... comp30
4/1/2012,price for company 1, price for company 2 ..... comp30
5/1/2012,price for company 1, price for company 2 ..... comp30
My Table 2 is setup with ID, Date_actual, Comp1, comp2..... comp30
Whilst my query works on its own, as soon as I try to append it , It changes my query to
INSERT INTO History ( Date_Actual )
SELECT Imported_Data.Date_Actual
FROM Imported_Data
GROUP BY Imported_Data.Date_Actual;
and doesn't work. i've tried merging the 2 but get syntax errors... ..always hated syntax issues, I know what I want but a missing comma/bracket thwarts me .
:banghead:
I'm sure its something simple ..been a long day and probably shouldn't have had the 2nd glass of wine before deciding to look at this but I'm grabbing moments when I can .
Hope it makes sense and thanks in advance

El-d