I'm hoping this is a simple question, but I can't figure out how to write my query to get the correct result!
I'm trying to translate a query from a report on our ERP solution (Dynamics NAV) into T-SQL.
I've gotten stuck with a condition of the report. In NAV, it retrieves all of the data using a set of filters - which is fine. After it retrieves the data, it goes through record by record, and 'skips' records which meet 2 conditions.
The condition for records being skipped are: If "Field A" <> 4 AND "Field B" = 0 THEN SKIP.
The closest i've got to recreating this in T-SQL is:
Select *
From t
WHERE [...] AND ( [FieldA] <> 4 AND [FieldB] = 0 )
This does not work!
How can I exclude records in T-SQL, only where ((A <> 4) AND (B = 0)) ?