• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 137
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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