got a slight problem where trying to work out how to do this sql.
tables are:
Appointments
------------
SequenceID | ScheduleID | ClientID | appointmentTime | CancelReason
TempSchedule
---------------
SequenceID | ScheduleID | ScheduleDate | OrganisationType | OrgCode
Practices
-------------
Code | Description
Schools
------------
Code | Description
Centres
------------
Code | Description
I need to return the following
appointments.SequenceID
appointments.appointmentTime
appointments.cancelReason
AND the description of the place the appointments at.
Now the description is the problem, In the TempSchedule table it holds the Organisation code which can be 'P'
for practice 'S' for school or 'C' for center. this code p/s/c will tell the sql which one the three tables it
needs to get the Descripition out of. It then needs to find the description in that table which matches the
OrgCode in the TempSchedule table.
Now I can do what i'm wanting in seperate sql statements but tring to do it all in one
Any ideas how I go about getting the Description part ?
tables are:
Appointments
------------
SequenceID | ScheduleID | ClientID | appointmentTime | CancelReason
TempSchedule
---------------
SequenceID | ScheduleID | ScheduleDate | OrganisationType | OrgCode
Practices
-------------
Code | Description
Schools
------------
Code | Description
Centres
------------
Code | Description
I need to return the following
appointments.SequenceID
appointments.appointmentTime
appointments.cancelReason
AND the description of the place the appointments at.
Now the description is the problem, In the TempSchedule table it holds the Organisation code which can be 'P'
for practice 'S' for school or 'C' for center. this code p/s/c will tell the sql which one the three tables it
needs to get the Descripition out of. It then needs to find the description in that table which matches the
OrgCode in the TempSchedule table.
Now I can do what i'm wanting in seperate sql statements but tring to do it all in one
Any ideas how I go about getting the Description part ?