I need helping writing a query that I have had to write anything like before.

I have a table where I have to loop through the records and write out values where certain conditions are missing.

I am comparing the value of 2 fields in TableA with the Values of 2 Fields in TableB. IF there is a record in TableA that does not have both fields match to TableB then write out a row

Example below

TableA
Fields= AccountNumber,Month,Year

TableB
Field = Month,Year

if there is a record in TableA where TableA.Month <> TableB.Month AND TableA.Year<>TableB.Year then write out the TableA.AccountNumber

I thought this would be simple, but I am not getting the results I am looking for. Any experts out there to help would be greatly appreciated as I am new to learning about complex query writing.

Thanks so much