I have 5000 records, two fields of which contain Categories and SubCategories. There are only a (small) finite number of possible values. These are kept in tblCategory, tblSubCategory, they are not linked (and do not need to be). Note that the Categories/SubCategories in the main table do change frequently.
I want to add a flag in my view that checks if the categories/subcategories in each record are valid by checking the contents of the table. The Categories/SubCategory tables will rarely change.
I just want something similar to CASE WHEN tblRecords.Category is in tblCategory.Category THEN 0 ELSE 1 END AS errCategory
How can I achieve this?
Try this: