0

Here is the code I'm running into an error with:

FROM
    IndexPID
    INNER JOIN Demographics ON
        IndexPID.NDoc_Number = Demographics.NDoc_Number,
    PatientSupply
    INNER JOIN Demographics ON
        PatientSupply.NDocNum = Demographics.NDoc_Number

I also tried it this way:

FROM
    IndexPID, PatientSupply
    INNER JOIN Demographics ON
        IndexPID.NDoc_Number = Demographics.NDoc_Number
    INNER JOIN Demographics ON
        PatientSupply.NDocNum = Demographics.NDoc_Number

But no cigar. Anybody tell me what I'm doing wrong?

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by PhilEaton
1

You can't really mix-and-match declarative join syntax with explicit join syntax.

So, for instance, you'd have to have each table joined to each other table like so:
...
from demographics
inner join IndexPID on IndexPID.NDoc_Number = Demographics.NDoc_Number
inner join PatientSupply on PatientSupply.NDocNum = Demographics.NDoc_Number
...

or like this:
...
FROM Demographics, IndexPID, PatientSupply
where IndexPID.NDoc_Number = Demographics.NDoc_Number
and PatientSupply.NDocNum = Demographics.NDoc_Number
...

Personally, I prefer the declarative syntax...but that's just me.

Hope this helps! Good luck

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.