Recordset_Selecting Server Event
My orginal SQL on the server was this
SELECT
b.event_id AS a,
b.user_ID AS a,
b.date AS a,
b.Time AS a
FROM quadtest AS a
JOIN quadtest AS b
WHERE a.date
= b.date
AND time_to_sec(a.Time
) - time_to_sec(b.Time
) BETWEEN -30 AND 30");
I then as a trial just did this in Table Specific\Common\Recordset_selecting
function Recordset_Selecting(&$filter) {
ew_AddFilter($filter, "quadtest.date = '2017/01/01'");
}
and it worked fine so im adding in the right place and the syntax is correct
Next I tried this
function Recordset_Selecting(&$filter) {
ew_AddFilter($filter, "SELECT
b.event_id AS a,
b.user_ID AS a,
b.date AS a,
b.Time AS a
FROM quadtest AS a
JOIN quadtest AS b
WHERE a.date
= b.date
AND time_to_sec(a.Time
) - time_to_sec(b.Time
) BETWEEN -30 AND 30");}
Failure - I assume its a syntaxt issue
My eventual aim is for the user to be able to add a value via the search page for the 30 in the between statement, but though moving in stages would be sensible ?
Regards
John B