G
Guest
I am going to need lots of help and patients with this one.
I think my basic question is:
How do I set up a join so that my main table can get prices attached to it
for 4 different fields which hold the same data type?
I have received error messages such as: Ambiguous join error . . . . . .it
tells me to create a separate query and then include that query in the sql -
- - I don't know even how to do a separate query. Can you break this down
into small steps with explanations please. cell phone: 954-234-4239
The main data table ENCOUNTER which has fields
proc_code
proc_code1
proc_code2
proc_code3
the pricing for these codes reside in table named procedurecodes
and the 3 fields in PROCEDURECODES are:
procedure fees description
So each record in ENCOUNTER has up to 4 codes populated.
I need to run a query which will result in a price for each proc_cod.
Thus
record 1 proc_code 55788 proc_code1 55899 proc_code2
55898
should RESULT IN:
record 1 proc_code 55788 $74 proc_code1 55899 $86 proc_code2 55898
$120. . . .etc
So if I do a standard join I drop records.
Below is the code I used.
below is some code I started using
FROM UPIN, HCFA_ADD_FAC32, HCFA_ADD_SUP33, PROVIDERTAXID, procedurecodes AS
procedurecodes_1 INNER JOIN (procedurecodes INNER JOIN ((ALF INNER JOIN
pt_ALF ON ALF.ALFid = pt_ALF.ALFid) INNER JOIN (encounter INNER JOIN
diagnosis ON encounter.diagcode = diagnosis.diagcode) ON pt_ALF.ID_pt_ALF =
encounter.ID_pt_ALF) ON procedurecodes.procedure = encounter.proc_code) ON
procedurecodes_1.procedure = encounter.proc_code2
I think my basic question is:
How do I set up a join so that my main table can get prices attached to it
for 4 different fields which hold the same data type?
I have received error messages such as: Ambiguous join error . . . . . .it
tells me to create a separate query and then include that query in the sql -
- - I don't know even how to do a separate query. Can you break this down
into small steps with explanations please. cell phone: 954-234-4239
The main data table ENCOUNTER which has fields
proc_code
proc_code1
proc_code2
proc_code3
the pricing for these codes reside in table named procedurecodes
and the 3 fields in PROCEDURECODES are:
procedure fees description
So each record in ENCOUNTER has up to 4 codes populated.
I need to run a query which will result in a price for each proc_cod.
Thus
record 1 proc_code 55788 proc_code1 55899 proc_code2
55898
should RESULT IN:
record 1 proc_code 55788 $74 proc_code1 55899 $86 proc_code2 55898
$120. . . .etc
So if I do a standard join I drop records.
Below is the code I used.
below is some code I started using
FROM UPIN, HCFA_ADD_FAC32, HCFA_ADD_SUP33, PROVIDERTAXID, procedurecodes AS
procedurecodes_1 INNER JOIN (procedurecodes INNER JOIN ((ALF INNER JOIN
pt_ALF ON ALF.ALFid = pt_ALF.ALFid) INNER JOIN (encounter INNER JOIN
diagnosis ON encounter.diagcode = diagnosis.diagcode) ON pt_ALF.ID_pt_ALF =
encounter.ID_pt_ALF) ON procedurecodes.procedure = encounter.proc_code) ON
procedurecodes_1.procedure = encounter.proc_code2