J
Josh
Hello folks!
Can someone help me with the following SELECT statement? I
apologize that this is tedious. I get "error in the FROM
clause" when trying to run this. I've looked for a couple
of days and I don't see the problem.
SELECT t.SlotID, t.DID AS TDID, t.ApptCodeID AS
TApptCodeID, t.ApptStart AS TApptStart, t.DayOfWk, n.*, IIf
(IsNull(a.ApptStart),t.ApptStart], a.ApptStart) AS Sort
FROM ApptTemplate AS t
LEFT JOIN [SELECT a.AppointmentID, a.ApptTypeID,
a.ApptCodeID, a.RecordID AS PersonID, a.DID, a.ApptDate,
a.ApptStart AS OVApptStart, a.TmStamp, a.DateUpdated,
a.DateCreated, a.SlotID AS ASlotID, a.ApptComment,
ovd.ApptOVDetailID, ovd.AppointmentID AS DApptID,
ovd.ApptReasonCode, ovd.TmStamp AS DTmStamp, p.LastName,
p.FirstName, p.NickName, p.NPInfo FROM Person AS p INNER
JOIN (Appointment AS a LEFT JOIN ApptOVDetail AS ovd ON
a.AppointmentID = ovd.AppointmentID) ON p.PersonID =
a.RecordID WHERE (((a.ApptTypeID)=1 Or (a.ApptTypeID)=2))
AND (a.ApptDate)=[forms]![ApptFrm2]![ApptDateSelect]]. AS
n ON t.SlotID = n.ASlotID
WHERE (((t.DID)=[forms]![apptFrm2]![cboDID]))
ORDER BY IIf(IsNull([OVApptStart]),[TApptStart],
[OVApptStart]);
Thanks so much!!
Josh
Can someone help me with the following SELECT statement? I
apologize that this is tedious. I get "error in the FROM
clause" when trying to run this. I've looked for a couple
of days and I don't see the problem.
SELECT t.SlotID, t.DID AS TDID, t.ApptCodeID AS
TApptCodeID, t.ApptStart AS TApptStart, t.DayOfWk, n.*, IIf
(IsNull(a.ApptStart),t.ApptStart], a.ApptStart) AS Sort
FROM ApptTemplate AS t
LEFT JOIN [SELECT a.AppointmentID, a.ApptTypeID,
a.ApptCodeID, a.RecordID AS PersonID, a.DID, a.ApptDate,
a.ApptStart AS OVApptStart, a.TmStamp, a.DateUpdated,
a.DateCreated, a.SlotID AS ASlotID, a.ApptComment,
ovd.ApptOVDetailID, ovd.AppointmentID AS DApptID,
ovd.ApptReasonCode, ovd.TmStamp AS DTmStamp, p.LastName,
p.FirstName, p.NickName, p.NPInfo FROM Person AS p INNER
JOIN (Appointment AS a LEFT JOIN ApptOVDetail AS ovd ON
a.AppointmentID = ovd.AppointmentID) ON p.PersonID =
a.RecordID WHERE (((a.ApptTypeID)=1 Or (a.ApptTypeID)=2))
AND (a.ApptDate)=[forms]![ApptFrm2]![ApptDateSelect]]. AS
n ON t.SlotID = n.ASlotID
WHERE (((t.DID)=[forms]![apptFrm2]![cboDID]))
ORDER BY IIf(IsNull([OVApptStart]),[TApptStart],
[OVApptStart]);
Thanks so much!!
Josh