Thanks Albert

I kept trying different Where clauses and other methods
but forgot all about a temp table.

I need to cut down some trees so I can see the forest!

Marc


----- Original Message ----- From: "Albert Berry" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Tuesday, October 14, 2008 10:26 AM
Subject: [RBASE-L] - Re: Insert question


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