>SELECT a.date, a.concept, SUM(a.amount) AS n_impo, a.quotas ; > FROM Master a ; > WHERE BETWEEN(a.date,tdDateFrom,tdDateTo) ; > OR a.plan = .T. ; > AND a.date <= {tdDateTo} ; ---->>>> this encapsulating in {} says "take this literal and treat it as a date". Since it's already a date, <b>AND a.date <= tdDateTo</b> should be sufficient. > AND ALLT(a.quotas) <> "0" ; > ORDER BY a.date ; > GROUP BY a.nro_oper ; > INTO CURSOR c_names >>