I've got a database query (modeling a Doctor's office) that I need to run. I've got a table with patients, and another with appointment times. Now, I can create a query to show all appointments easily enough. What I need to know is how to I reference the values of text boxes on a form in SQL?
For example, I've got a form with the following:
TextBox named fnamebox
TextBox named lnamebox
Button named btnSearch
The btnSearch initiates a SQL query with roughtly the following:
SELECT Patients.FirstName, Patients.LastName, Appointments.AppointmentTime, Appointments.AppointmentDate
FROM Patients INNER JOIN Appointments ON Patients.PatientID=Appointments.PatientID;
Now I need to add a WHERE in that says Patients.FirstName = (whatever is in fnamebox) and Patients.LastName = (whatever is in lnamebox)
Any idea on how to reference that data?
For example, I've got a form with the following:
TextBox named fnamebox
TextBox named lnamebox
Button named btnSearch
The btnSearch initiates a SQL query with roughtly the following:
SELECT Patients.FirstName, Patients.LastName, Appointments.AppointmentTime, Appointments.AppointmentDate
FROM Patients INNER JOIN Appointments ON Patients.PatientID=Appointments.PatientID;
Now I need to add a WHERE in that says Patients.FirstName = (whatever is in fnamebox) and Patients.LastName = (whatever is in lnamebox)
Any idea on how to reference that data?
