In VFP 9 SP1, I have the following SQL query:
The object method ReturnFinancialYearEnd looks like this:
I find the above query causes error 11 (Function argument value, type, or count is invalid) in the method code because the parameter is being fed with an empty date.
I don't understand this because the SQL WHERE clause specifies date>{}.
Can someone explain this?
Thanks,
Stewart
Code:
SELECT obiz.ReturnFinancialYearEnd(DonDate) AS YearEnd, ROUND(SUM(Amount*22/78),2) AS TaxAmount ;
FROM donation ;
WHERE dondate>{} AND Claimed={^2007-01-18} ;
INTO CURSOR curTemp2 GROUP BY 1
Code:
LPARAMETERS ForDate
IF VARTYPE(ForDate)=[D]
RETURN IIF(MONTH(ForDate)<10 ;
, DATE(YEAR(IIF(VARTYPE(ForDate)=[N] ;
, DATE()+ForDate;
, ForDate)),9,30) ;
, DATE(YEAR(IIF(VARTYPE(ForDate)=[N] ;
, DATE()+ForDate;
, ForDate)) +1,9,30))
ELSE
RETURN IIF(MONTH(DATE())<10 ;
, DATE(YEAR(DATE())+ForDate,9,30) ;
, DATE(YEAR(DATE())+ForDate +1,9,30))
ENDIF
I don't understand this because the SQL WHERE clause specifies date>{}.
Can someone explain this?
Thanks,
Stewart