Try adding () around those 'or', let us know if it works.
WHERE A.Field1 = B.Field1
(A.Field2 =B.Field2 OR
A.Field3 =B.Field2 OR
A.Field4 =B.Field2 OR
On Thu, 1 May 2008 18:14:18 -0700, newbie <itissandeep@GMAIL.COM> wrote:
>I'm trying to use PROC SQL to create a new dataset based on two other
>It looks something like the following:
> CREATE TABLE C AS
> SELECT * FROM A, B
> WHERE A.Field1 = B.Field1
>A.Field2 =B.Field2 OR
>A.Field3 =B.Field2 OR
>A.Field4 =B.Field2 OR
>A.Field100 =B.Field2 ;
>This is what I want it to do:
>I have 100 date fields which are to be compared. If the ID (Field1)
>matches in any of the records in A and in B AND the any of the 100
>date fields in the same record in A also matches fixed date field in B
>then I want to include the complete record of dataset A + dataset B.
>But apparently I am getting 0 records, though I know there are some
>Can somebody tell me what is wrong or suggest a better procedure ?
>Thanks a ton