This topic is locked

Filter in SQL

4/6/2012 8:22:45 AM
PHPRunner General questions
S
scoobysteve author

Hi folks,
I have aPHPRunner application that I want to only show on the List page all entries that have a certain field empty or where that field does not contain the word "awaiting"
I have tried using the filter <>"awaitng" or ="" but this does not show up the correct results, can anyone help please
Basically I do not want to display the records that have "awaiting" in Field16
Regards
Steve

C
cgphp 4/6/2012

In the "Before SQL query" event, enter the following code:



$strWhereClause = "field_name IS NOT NULL AND field_name != '' AND field_name != 'awaiting'";


Replace field_name with the real name of the field.

S
scoobysteve author 4/7/2012



In the "Before SQL query" event, enter the following code:



$strWhereClause = "field_name IS NOT NULL AND field_name != '' AND field_name != 'awaiting'";


Replace field_name with the real name of the field.


Thanks but this returned no results. The field that has the value in is called Spare16.
In only 2 records out of 160 have a value "awaiting" in "Spare16" the rest have nothing the fields are empty.

I only want to display the records from those that do not have the word "waiting" in "Spare16" in other words the records with a

null value in Spare16
Kind Regards
Steve

C
cgphp 4/7/2012
$strWhereClause = "Spare16 IS NULL OR Spare16 = ''";
S
scoobysteve author 4/7/2012


$strWhereClause = "Spare16 IS NULL OR Spare16 = ''";



Thank you Sir your help is appreciated very much, have a great day that worked a treat.
Steve

S
scoobysteve author 4/7/2012


$strWhereClause = "Spare16 IS NULL OR Spare16 = ''";



Just noticed when I do a search all the records are displayed that have a null value in Spare16 instead of the actual search results ??

Its the same results each time no matter what I search for

No sure if anything can be done with this.
Regards

Steve