I have a query that I'm changing from running on Access to being passed through to SQL, and it's tripping errors that it never did before.
One possibility that I thought of is that I'm not sure if some of my conditional statements work the same in SQL Server as they do in Access. For instance, in my existing query I test to see if a date has been entered into a field called Closed with a statement like the following:
WHERE c.Closed
In Access this returns true whenever anything is entered in Closed, and false otherwise. Does SQL Server work the same way? If not, is there an elegant way to test the same thing, or do I have to explicitly test for emptiness and nullness?
This doesn't seem to be exactly the same as a boolean literal (for which an answer already exists), as those are literally valued "True" or "False". Here I'm comparing to the behavior in Access where some data types which aren't zero length, zero (value) or null evaluate to True when used in a conditional. Microsoft describes this as data types which are "implicitly convertible to boolean" within conditional statements. I thought this was different than a literal. Or at least, it's unclear enough that I think a separate question is appropriate.