Hi All,
I have a table with year, quarter, item, and four different dollar fields.
I am trying to build a query that will display records that have year, quarter and the first 8 out of 16 positions of the item field that match but only if at least one of the dollar fields are different.
Example:
Year Qtr Item $1 $2 $3 $4
=======================================================
2006 1 abc 99997 10 2.5 3.5 5.5
2006 1 abc 99999 5 2.5 3.5 5.5
2006 2 zyz 99997 2.3 5.5 2.5 3.5
2006 2 zyz 99999 2.3 5.5 2.1 3.5
The first and second group of records above should return from the query that I desire. However something like below should not be returned because the dollars match.
Example:
Year Qtr Item $1 $2 $3 $4
=======================================================
2006 1 abc 99997 10 2.5 3.5 5.5
2006 1 abc 99999 10 2.5 3.5 5.5
2006 2 zyz 99997 2.3 5.5 2.5 3.5
2006 2 zyz 99999 2.3 5.5 2.5 3.5
I think I need some kind of sub query since I am querying on the same table to try to match the year, qtr and item (first 8 character only) as the key.
Is my issue clear as mud?
I really appreciate the help.
Thank you for all your help
Tom
I have a table with year, quarter, item, and four different dollar fields.
I am trying to build a query that will display records that have year, quarter and the first 8 out of 16 positions of the item field that match but only if at least one of the dollar fields are different.
Example:
Year Qtr Item $1 $2 $3 $4
=======================================================
2006 1 abc 99997 10 2.5 3.5 5.5
2006 1 abc 99999 5 2.5 3.5 5.5
2006 2 zyz 99997 2.3 5.5 2.5 3.5
2006 2 zyz 99999 2.3 5.5 2.1 3.5
The first and second group of records above should return from the query that I desire. However something like below should not be returned because the dollars match.
Example:
Year Qtr Item $1 $2 $3 $4
=======================================================
2006 1 abc 99997 10 2.5 3.5 5.5
2006 1 abc 99999 10 2.5 3.5 5.5
2006 2 zyz 99997 2.3 5.5 2.5 3.5
2006 2 zyz 99999 2.3 5.5 2.5 3.5
I think I need some kind of sub query since I am querying on the same table to try to match the year, qtr and item (first 8 character only) as the key.
Is my issue clear as mud?
I really appreciate the help.
Thank you for all your help
Tom