Susan
|
| Posted: 11/21/2004, 2:22 PM |
|
I have a list box set up in the search grid "s_pending" with ListOfValues 1;Pending;2;Finished
In the grid "tasks" I have {task_finish_date}
I would like the search to display in the grid,
tasks with a NULL {task_finish_date} which would be PENDING.
and tasks which IS NOT NULL{task_finish_date} which would be FINISHED
and no selection would display All tasks.
I was suggested to use:
Switch Table to SQL
SELECT *
FROM `tasks`
WHERE task_finish_date {padding}
{padding} = + Parameter
Variable Name = padding
Parameter = CCGetPadding(CCGetFromGet("s_pending", 1))
Type: Expression
s_pending = the 1;Pending;2;Finished from the Search Listbox
A small Function write in the Common:
function CCGetPadding($padding)
{
if($padding == 1) {
$wherepadding = "IS NULL"; }
elseif($padding == 2) {
$wherepadding = "IS NOT NULL"; }
return $wherepadding;
}
But MySQL said:
You have an error in your SQL syntax near '{padding} {padding} = + Parameter Variable Name = padding Parameter
Anyone know what the correct code would be?
|
|
|
 |
|