J
Jack Sheet
Hi all.
I have a database with two tables:
T_Clients
T_Tasks
T_Clients has two fields:
ClientID = autonumber, primary key
ClientName = text, indexed, no duplicates
T_Tasks has three fields:
TaskID = autonumber, primary key
ClientID = number
Date = date/time
There is a one(T_Clients)-to-many(T_Tasks) relationship between ClientID
fields with enforced referencial integrity.
I wish to run a query to add records to T_Tasks based on the following
rules:
For each value of ClientID in the T_Clients table, if there does not already
exist a corresponding record in T_Tasks wherein the value of the Date field
= 05 April 2006, then create such a record (with date 05 April 2006), but if
there does already exist such a record then ignore that value of ClientID.
So, which of "Update" query or "Append" query should I use, and what is the
syntax of the criteria expression, please? I hardly ever do action queries,
as you can tell. It "sounds" like an "Append" query but the help notes
indicate that that should be used for appending one table to another, but I
just want to add records to an existing table.
Thanks in advance.
I have a database with two tables:
T_Clients
T_Tasks
T_Clients has two fields:
ClientID = autonumber, primary key
ClientName = text, indexed, no duplicates
T_Tasks has three fields:
TaskID = autonumber, primary key
ClientID = number
Date = date/time
There is a one(T_Clients)-to-many(T_Tasks) relationship between ClientID
fields with enforced referencial integrity.
I wish to run a query to add records to T_Tasks based on the following
rules:
For each value of ClientID in the T_Clients table, if there does not already
exist a corresponding record in T_Tasks wherein the value of the Date field
= 05 April 2006, then create such a record (with date 05 April 2006), but if
there does already exist such a record then ignore that value of ClientID.
So, which of "Update" query or "Append" query should I use, and what is the
syntax of the criteria expression, please? I hardly ever do action queries,
as you can tell. It "sounds" like an "Append" query but the help notes
indicate that that should be used for appending one table to another, but I
just want to add records to an existing table.
Thanks in advance.