sqljet

SQL query using INNER JOIN is excluding some database records where the field value is MP


I have this SQL query:

SELECT [Public Talk Titles].*, [Public Talk Categories].Description AS [Category Description]
FROM [Public Talk Categories] 
INNER JOIN [Public Talk Titles] ON [Public Talk Categories].Category = [Public Talk Titles].Category
ORDER BY [Public Talk Titles].[Talk Number];

It works, except, it does not like it when the value of Category is MP. All database rows where the category is that value are stripped from the database. I am using Microsoft Access 2016 with a MDB file.

If I change the category from MP to something else, eg XX in both the tables and run my query it works as expected and all records are displayed.

So it is something to do with this MP value. Thanks for your help.


Solution

  • Make sure the value MP is exactly the same in both tables, try trimming the strings and inserting again or run something like UPDATE table SET column = 'MP' where column LIKE '%MP%'