G
Guest
Hi,
I have a series of Orders tables (each dated a Friday for 8 weeks) from
Accounting that I need to combine, with the following FIELDS (OrderNum,
OrderDate, ItemID, ItemDesc, CustNum, CustName, Ordered, Shipped). They each
have approx 6 weeks of data, but we need to have the whole year 2005 in one
table. Each table has ~50,000 records, and hundreds are duplicates, so I'd
like to APPEND one to previous, and if these fields are equal (OrderNum,
OrderDate, ItemID, CustNum, Ordered, Shipped) for a record, I'd like to skip
it. I thought I would just have to set up the Append query with the Unique
Value property to YES, and the query would do what I want. But it appends
every single record from the later table, including all the duplicated
records! What am I not understanding? Here's the SQL:
INSERT INTO [Daily_allo-positive] ( OrderNum, OrderDate, ItemID, CustNum,
Ordered, Shipped )
SELECT DISTINCT [Daily_allo-0225].OrderNum, [Daily_allo-0225].OrderDate,
[Daily_allo-0225].ItemID, [Daily_allo-0225].CustNum,
[Daily_allo-0225].Ordered, [Daily_allo-0225].Shipped
FROM [Daily_allo-0225];
Thanks much, this seems like such an easy fix, but I'm killing myself
looking for a solution. And I can't just delete or ignore all records before
a previous date, because occassionally an Ordered or Shipped value will
change as to be expected.
I have a series of Orders tables (each dated a Friday for 8 weeks) from
Accounting that I need to combine, with the following FIELDS (OrderNum,
OrderDate, ItemID, ItemDesc, CustNum, CustName, Ordered, Shipped). They each
have approx 6 weeks of data, but we need to have the whole year 2005 in one
table. Each table has ~50,000 records, and hundreds are duplicates, so I'd
like to APPEND one to previous, and if these fields are equal (OrderNum,
OrderDate, ItemID, CustNum, Ordered, Shipped) for a record, I'd like to skip
it. I thought I would just have to set up the Append query with the Unique
Value property to YES, and the query would do what I want. But it appends
every single record from the later table, including all the duplicated
records! What am I not understanding? Here's the SQL:
INSERT INTO [Daily_allo-positive] ( OrderNum, OrderDate, ItemID, CustNum,
Ordered, Shipped )
SELECT DISTINCT [Daily_allo-0225].OrderNum, [Daily_allo-0225].OrderDate,
[Daily_allo-0225].ItemID, [Daily_allo-0225].CustNum,
[Daily_allo-0225].Ordered, [Daily_allo-0225].Shipped
FROM [Daily_allo-0225];
Thanks much, this seems like such an easy fix, but I'm killing myself
looking for a solution. And I can't just delete or ignore all records before
a previous date, because occassionally an Ordered or Shipped value will
change as to be expected.