This topic is locked

NULL or Not NULL

10/22/2006 2:56:27 PM
PHPRunner General questions
M
mmponline author

I'm trying to run a querry to show data when a filed has info in it (Not Null) and do not show when the field is empty.
When I set the query to where `RefNo` is Not NULL - it shows all fields, even though one field is empty. When setting to is NULL, it shows no fields, instead of the empty field. Where am I going wrong?
Further, is it possible to set it on the specific field's custom code (and how). As I experienced the hard way, if you change the edit SQL query page - step 4 - you loose ALL manual formatting on the Visual editor's page, losing hours of work.

Alexey admin 10/23/2006

Stephan,
I suppose here are the WHERE clauses you need.
To select non-empty values:

where (RefNo is not null and RefNo<>'')



Empty values

where (RefNo is null or RefNo='')


You shouldn't loose any changes made on Visual Editor page after you change SQL query.

Please clarify what did you change and how did you loose the formatting.

M
mmponline author 10/23/2006

Thanks
This works fine. Sent formatting eg. to support e-mail address
Stephan