Simple SQL Problem

moagli

Registered User.
Local time
Today, 08:28
Joined
Nov 17, 2006
Messages
15
I have some simple sql code:
SELECT tblappointment.Appointment_type, tblpatient.Type_of_care, tblappointment.price, [type_of_care] & " " & [appointment_type] AS total, Switch([total]=tblpricing.price) AS Price
FROM tblappointment;

However i think it is all wrong, i want it to take this [type_of_care] & " " & [appointment_type] AS total
from this total i want it to reference with a table called tblpricing to find the correct price for that value. tblpricing is a table that contains two columns, one with the name and the other with the price, i then want to the price to be entered into tblappointment.price column for a bill to be calculated. Any more info needed just ask, but hopefully someone can help!!
 
That still does not work, im not sure if this makes a difference but type_of_care comes from one table and appointment type another, so i am unsure as how to link link tblappointment to tblpricing??
 

Users who are viewing this thread

Back
Top Bottom