A
Amy Adams via AccessMonster.com
The following SQL statement is an Append Query that I am running in my
database.
When someone adds a New Physician into the database, this append query adds
plans and groups to the new physician. The problem I am having is that the
end user is sometimes running this append on exsisting physicians who
already have plans and groups attached. When they run an append on an
exisiting physiscian duplicate records are created. Is it possible to add
something to the below SQL statement that would prevent the append from
running if physician already has plans and groups loaded?
Example:
INSERT INTO PhysicianPlan ( UPIN, PlanID, GroupID )
SELECT Physicians.UPIN, Plans.PlanID, PhysicianGroup.GroupID
FROM Plans, TempPhyPlan, Physicians INNER JOIN PhysicianGroup ON
Physicians.UPIN = PhysicianGroup.UPIN
WHERE (((Physicians.LastName) Like "*" & [LN] & "*") AND (
(Physicians.FirstName) Like "*" & [FN] & "*"));
Any advice is greatly appreciated.
Thanks so much
Amy
database.
When someone adds a New Physician into the database, this append query adds
plans and groups to the new physician. The problem I am having is that the
end user is sometimes running this append on exsisting physicians who
already have plans and groups attached. When they run an append on an
exisiting physiscian duplicate records are created. Is it possible to add
something to the below SQL statement that would prevent the append from
running if physician already has plans and groups loaded?
Example:
INSERT INTO PhysicianPlan ( UPIN, PlanID, GroupID )
SELECT Physicians.UPIN, Plans.PlanID, PhysicianGroup.GroupID
FROM Plans, TempPhyPlan, Physicians INNER JOIN PhysicianGroup ON
Physicians.UPIN = PhysicianGroup.UPIN
WHERE (((Physicians.LastName) Like "*" & [LN] & "*") AND (
(Physicians.FirstName) Like "*" & [FN] & "*"));
Any advice is greatly appreciated.
Thanks so much
Amy