I've got a query on a PHP page that accesses a VFP DBF file. The query looks like this:
"SELECT COUNT(IDNO) FROM ZMR
WHERE $race_fields[$i] = 'Y'
AND RACE = '$race_codes[$i]'
AND IDNO IN (SELECT IDNO FROM ZENROLL
WHERE ENRL_DATE BETWEEN {{$t1}} AND {{$t2}} AND EMPTY(ENRL_DATE) = .F.)";
ENRL_DATE is a date field. The problem is, this query never returns any records, even though it should (because I'm still testing it using valid dates). I've tried the subquery by itself and narrowed the problem down to:
ENRL_DATE BETWEEN {{$t1}} and {{$t2}}
$t1 and $t2 are strings in the format 'yyyy-mm-dd'.
I've also tried using the carat (^), but to no avail.
Please help me if you can.
Thanks.
"SELECT COUNT(IDNO) FROM ZMR
WHERE $race_fields[$i] = 'Y'
AND RACE = '$race_codes[$i]'
AND IDNO IN (SELECT IDNO FROM ZENROLL
WHERE ENRL_DATE BETWEEN {{$t1}} AND {{$t2}} AND EMPTY(ENRL_DATE) = .F.)";
ENRL_DATE is a date field. The problem is, this query never returns any records, even though it should (because I'm still testing it using valid dates). I've tried the subquery by itself and narrowed the problem down to:
ENRL_DATE BETWEEN {{$t1}} and {{$t2}}
$t1 and $t2 are strings in the format 'yyyy-mm-dd'.
I've also tried using the carat (^), but to no avail.
Please help me if you can.
Thanks.