Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 134
  • Last Modified:

Null Statement Correct??

In this sql string, is the portion that looks for a null value correct on the last line?

        esql = "Select * from " & c & " Where StartDate >= " & pound & a & pound
        esql = esql & " And StartDate <= " & pound & b & pound
        esql = esql & " And (SchoolWorkplaceBehavior = 0 Or SchoolWorkplaceBehavior = Null) "
0
al4629740
Asked:
al4629740
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:

        esql = "Select * from " & c & " Where StartDate >= " & pound & a & pound
        esql = esql & " And StartDate <= " & pound & b & pound
        esql = esql & " And (SchoolWorkplaceBehavior = 0 Or SchoolWorkplaceBehavior IS Null) "
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
esql = esql & " And (SchoolWorkplaceBehavior = 0 Or SchoolWorkplaceBehavior = Null) "

should be

esql = esql & " And (SchoolWorkplaceBehavior = 0 Or SchoolWorkplaceBehavior Is Null) "

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now