Hi all -
I'm trying to understand an issue I'm having with a particular query and was hoping someone could explain. When comparing fields between two tables, on text field comparison returns results if the two text fields are specified to be equal. However, if I set them to not equal each other "<>", the query returns no results which I don't expect and have validated a control set of data to ensure there should be results.
Here are the two queries.
Matching - returns 2 rows as expected.
SELECT tbl_PAL_Current.[Short Description (30)], tbl_PAL_Current.[Manufacturer's Item ID], PMPROD_PM_ITEM_MFG.ITEM_ID AS PM_MFG_ITEM_ID, PMPROD_PM_ITEM_MFG.MANUFACTURER_ITEM_ID, PMPROD_PM_ITEM_MFG.ITEM_ID
FROM tbl_PAL_Current INNER JOIN PMPROD_PM_ITEM_MFG ON tbl_PAL_Current.[Manufacturer's Item ID] = PMPROD_PM_ITEM_MFG.MANUFACTURER_ITEM_ID
WHERE (((PMPROD_PM_ITEM_MFG.ITEM_ID)=[tbl_PAL_Current].[Item ID]));
Not matching - returns 0 rows, but expect 11.
SELECT tbl_PAL_Current.[Short Description (30)], tbl_PAL_Current.[Manufacturer's Item ID], PMPROD_PM_ITEM_MFG.ITEM_ID AS PM_MFG_ITEM_ID, PMPROD_PM_ITEM_MFG.MANUFACTURER_ITEM_ID, PMPROD_PM_ITEM_MFG.ITEM_ID
FROM tbl_PAL_Current INNER JOIN PMPROD_PM_ITEM_MFG ON tbl_PAL_Current.[Manufacturer's Item ID] = PMPROD_PM_ITEM_MFG.MANUFACTURER_ITEM_ID
WHERE (((PMPROD_PM_ITEM_MFG.ITEM_ID)<>[tbl_PAL_Current].[Item ID]));
Both Item_ID and Item ID are text fields, although field size is different (which I don't think should impact the results).
Any thoughts?!
Thanks,
Sandcreek
I'm trying to understand an issue I'm having with a particular query and was hoping someone could explain. When comparing fields between two tables, on text field comparison returns results if the two text fields are specified to be equal. However, if I set them to not equal each other "<>", the query returns no results which I don't expect and have validated a control set of data to ensure there should be results.
Here are the two queries.
Matching - returns 2 rows as expected.
SELECT tbl_PAL_Current.[Short Description (30)], tbl_PAL_Current.[Manufacturer's Item ID], PMPROD_PM_ITEM_MFG.ITEM_ID AS PM_MFG_ITEM_ID, PMPROD_PM_ITEM_MFG.MANUFACTURER_ITEM_ID, PMPROD_PM_ITEM_MFG.ITEM_ID
FROM tbl_PAL_Current INNER JOIN PMPROD_PM_ITEM_MFG ON tbl_PAL_Current.[Manufacturer's Item ID] = PMPROD_PM_ITEM_MFG.MANUFACTURER_ITEM_ID
WHERE (((PMPROD_PM_ITEM_MFG.ITEM_ID)=[tbl_PAL_Current].[Item ID]));
Not matching - returns 0 rows, but expect 11.
SELECT tbl_PAL_Current.[Short Description (30)], tbl_PAL_Current.[Manufacturer's Item ID], PMPROD_PM_ITEM_MFG.ITEM_ID AS PM_MFG_ITEM_ID, PMPROD_PM_ITEM_MFG.MANUFACTURER_ITEM_ID, PMPROD_PM_ITEM_MFG.ITEM_ID
FROM tbl_PAL_Current INNER JOIN PMPROD_PM_ITEM_MFG ON tbl_PAL_Current.[Manufacturer's Item ID] = PMPROD_PM_ITEM_MFG.MANUFACTURER_ITEM_ID
WHERE (((PMPROD_PM_ITEM_MFG.ITEM_ID)<>[tbl_PAL_Current].[Item ID]));
Both Item_ID and Item ID are text fields, although field size is different (which I don't think should impact the results).
Any thoughts?!
Thanks,
Sandcreek