Marc, create a temp table and insert into that. When you do the insert into the temp table, include another clause in the where to eliminate any that are already in AptBook. Then you can simply insert into the AptBook with no errors because you have already eliminated the duplicates.

Marc wrote:
Hi

I know this should be easy but I just can't seem to figure it out.
This Insert statement works fine but if the row already exists
you get a bunch of errors that you have to skip through.
There is a PK on those 3 columns.

How would I add when the row does not Exist?

INSERT +
INTO aptbook (aptdate,apttime,ampm) +
SELECT t1.aptdate,t2.apttime,t2.ampm +
FROM aptdate t1, apttime t2 +
WHERE aptdate BETWEEN .vsdate AND .vedate +
ORDER BY aptdate,apttime

Thanks
Marc





Reply via email to