GaryWilsonCPA
Technical User
THIS UNION JOIN WORKS UNTIL I ADD
"appointment_scheduling.client_name as NAME" on the fifth line of the SELECT in section one.
I do not add this to the 5th line of the SELECT on the second section of the union because NAME is not in the table to choose.
Any suggestions?
SELECT
appointment_scheduling.PATID as PATID,
appointment_scheduling.appointment_date as DATE,
appointment_scheduling.service_code as SERVICECODE,
appointment_scheduling.client_name as NAME
FROM SYSTEM.appointment_scheduling
UNION ALL
SELECT
staff_tx_history_all.PATID as PATID,
staff_tx_history_all.date_of_service as DATE,
staff_tx_history_all.SERVICE_CODE as SERVICECODE
FROM
SYSTEM.staff_tx_history_all
"appointment_scheduling.client_name as NAME" on the fifth line of the SELECT in section one.
I do not add this to the 5th line of the SELECT on the second section of the union because NAME is not in the table to choose.
Any suggestions?
SELECT
appointment_scheduling.PATID as PATID,
appointment_scheduling.appointment_date as DATE,
appointment_scheduling.service_code as SERVICECODE,
appointment_scheduling.client_name as NAME
FROM SYSTEM.appointment_scheduling
UNION ALL
SELECT
staff_tx_history_all.PATID as PATID,
staff_tx_history_all.date_of_service as DATE,
staff_tx_history_all.SERVICE_CODE as SERVICECODE
FROM
SYSTEM.staff_tx_history_all