Check for date in table

  • Thread starter Thread starter Tod
  • Start date Start date
T

Tod

I have an append query that appends data from one table to
another. I use the query monthly. Each set of data is for
a given month. I'm trying to come up with a way to insure
that I do not copy the data more than once. None of the
fields have unique values. (I don't have control over the
table structure.) However, each month of data has only
dates for that month. So I could check the table I'm
appending to for dates containing that month.

How can I use a query, macro or other to check that the
table does not have dates for the month of data I'm
appending and then prompt me or cancel the appending?

tod
 
Try refining you Append query with a WHERE clause that
checks that the date in the column on the monthly table is
greater than the Max date on the appended table e.g.

INSERT INTO etc
SELECT etc FROM etc
WHERE YourMonthlyTable.dateColumn > Select(Max(dateColumn)
FROM YourAppendedTable)

Hope This Helps
Gerald Stanley MCSD
 
So I could check the table I'm
appending to for dates containing that month.

If you will never have two valid records with the same date, simply
set a unique Index on the date.
 
Back
Top