I receive a .txt file each week where the first few columns are basic product data, and the next eight columns are upcoming weekly forecast numbers. The column headings for the forecast numbers is the appropriate Sunday's date, ie 8/19/2007, 8/26/2007. I am appending this data to a table, and this naming convention requires me to go into the query and add the latest date in the query to append.
What I'd like to create is a union query saying something like this: (the [File Date] field is always the first Sunday of data in the file)
SELECT Mid([Item Number],2) & Mid([Mfg Part],2) & Facility AS UniqueID,
[File Date], [Product Code], [Product ID], COLUMN 6 AS MAX( [File Date])
FROM Download
UNION ALL SELECT Mid([Item Number],2) & Mid([Mfg Part],2) & Facility AS UniqueID,
[File Date], [Product Code], [Product ID], COLUMN 7 AS AS DateAdd("w", 1,[File Date])
FROM Download
UNION ALL SELECT Mid([Item Number],2) & Mid([Mfg Part],2) & Facility AS UniqueID,
[File Date], [Product Code], [Product ID], COLUMN 8 AS AS DateAdd("w", 2,[File Date])
FROM Download
etc … ;
I can only find using column numbers (locations) when using combo/list boxes in forms. Is there any way to do this in a query? I'd like to break away from the manual selecting of each new week's data before appending. Using Access 2003.
Thanks for the help!
What I'd like to create is a union query saying something like this: (the [File Date] field is always the first Sunday of data in the file)
SELECT Mid([Item Number],2) & Mid([Mfg Part],2) & Facility AS UniqueID,
[File Date], [Product Code], [Product ID], COLUMN 6 AS MAX( [File Date])
FROM Download
UNION ALL SELECT Mid([Item Number],2) & Mid([Mfg Part],2) & Facility AS UniqueID,
[File Date], [Product Code], [Product ID], COLUMN 7 AS AS DateAdd("w", 1,[File Date])
FROM Download
UNION ALL SELECT Mid([Item Number],2) & Mid([Mfg Part],2) & Facility AS UniqueID,
[File Date], [Product Code], [Product ID], COLUMN 8 AS AS DateAdd("w", 2,[File Date])
FROM Download
etc … ;
I can only find using column numbers (locations) when using combo/list boxes in forms. Is there any way to do this in a query? I'd like to break away from the manual selecting of each new week's data before appending. Using Access 2003.
Thanks for the help!