Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Database Manager Dataset - Where a boolean = null
Mon, Mar 26 2018 10:27 PMPermanent Link

Paul Coshott

Avatar

Hi All,

I need to create an sql statement that will search for True, False or a null, using a parameter.
It is a field for staff requests. When it's created, it will be null. Then a manager will approve or not approve the request. When viewing the list of requests, the user can choose to view approved, not approved or undecided (those that are null).

So I can do :

 WHERE (StaffRequest.RequestApproved = {StaffReq=1})

I can use 1 or True, 0 or False, but what do I use to return the null values (null doesn't work).

Thanks,
Paul
Tue, Mar 27 2018 3:27 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Paul,

<< I need to create an sql statement that will search for True, False or a null, using a parameter.
It is a field for staff requests. When it's created, it will be null. Then a manager will approve or not approve the request. When viewing the list of requests, the user can choose to view approved, not approved or undecided (those that are null). >>

NULL values are a little tricky because you need to use the IS NULL operator.  In order to avoid any tricky and hard-to-read WHERE clauses, I would simply use a separate dataset for the NULL queries, and load it instead on the client if you need the undecideds.

Tim Young
Elevate Software
www.elevatesoft.com
Image