Add two fields to a query

augie0216

New member
Local time
Yesterday, 19:14
Joined
Jun 19, 2006
Messages
7
I have this query:
SELECT A.*, AppointmentCost - Nz((SELECT SUM(PaymentAmount) FROM tblPayment P WHERE A.AppointmentId = P.AppointmentId),0) AS AppBalance, Date()-AppointmentDate AS DaysOutstanding
FROM tblAppointment AS A;


When I run it shows:
AppointmentID
PaymentID
AppointmentCost
AppBalance
DaysOutStanding

I would like the first and last names of patients to show up in this query
I have a table called tblPatient which has these two fields in it.
Colud you please show how to do this, if it is even possible?
 
I don't see how a patient is tied to this tblAppointment by the information that you have given. To include the name, we need to know the data element that ties this record to a patient.
 

Users who are viewing this thread

Back
Top Bottom