SQL INSERT Query Master Detail Table

W

W Dean

Hi,

I have two tables set up with a Master Detail relational and I want to set
up an INSERT Query which will only insert records into the Detail Table if
Certain criteria are met in the master table. For example, Insert these
Values into the detail table only if the master record was created by the
specified user.

I'm try to use the following and it reports a missing ; error

INSERT INTO CalenderPics (MasterID,ID,...) VALUES (aValue,aValue,...) WHERE
(CalenderPics.MasterID IN (SELECT Calender.CalenderID AS MasterID FROM
Calender WHERE Calender.UserName='Test3'))

Does anyone know the correct syntax for this query?

W Dean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top