I am trying to create a grid application that will only return the records from tbl1 if tbl1.mscID matches tbl2.mscID. Basically, I’ve added a column to the users table (tbl2) that is mscID. and they data comes from tbl3. tbl3 only has 1 column which is varchar(11). So the logic is the user logs into the project and loads this application. The grid will check the tbl1.mscID and return records from tbl2 where tbl2.mscID is the same.
tbl1
Active (int)(1)
mscID (varchar)(11) <-- select from tbl3
name (varchar)(32)
submscID(varchar)(11)
tbl2
mscID(varchar)(11) <-- select from tbl3
submscID(varchar)(11)
SELECT
tbl1.Active,
tbl1.mscID,
tbl1.name,
tbl1.submscID,
tbl2.mscID,
tbl2.submscID
FROM
tbl1,
tbl2
WHERE
tbl1.Active = 1 AND
tbl1.mscID = tbl2.mscID
When I run the application it returns all records regardless of mscID.
What am I missing here?
Thanks