>>>>Hello all,
>>>>
>>>>
>>>>Error 11 (Function argument value, type, or count is invalid)
>>>>
>>>>SELECT DATE (Ann_Fisc, Periode, Jour) AS DtFisc, Mnt_PPA, Mnt_Depot;
>>>> FROM PPA_Det;
>>>> WHERE (No_Parten == PPA_Ent.No_Parten) AND (ALLTRIM (No_Facture) == ALLTRIM (PPA_Ent.No_Facture));
>>>> AND (DATE (Ann_Fisc, Periode, Jour) => THISFORM.cntPPA.txtDtPrel.Value);
>>>> AND (DATE (Ann_Fisc, Periode, Jour) > loParaPPA.dJour_Ferme);
>>>> INTO CURSOR curAjoutPPA
>>>>
>>>>This gives me error 11 in my app.
>>>>
>>>>When I do this in a command box
>>>>
>>>>SELECT DATE (Ann_Fisc, Periode, Jour) AS DtFisc, Mnt_PPA, Mnt_Depot;
>>>>FROM PPA_Det;
>>>>WHERE (No_Parten == PPA_Ent.No_Parten) AND (ALLTRIM (No_Facture) == ALLTRIM (PPA_Ent.No_Facture));
>>>> AND (DATE (Ann_Fisc, Periode, Jour) => {^2021.03.01});
>>>> AND (DATE (Ann_Fisc, Periode, Jour) > {^2021.01.15})
>>>>
>>>>Everything is fine. Any idea why I would get an error 11 only in my app?
>>>
>>>Are you sure that THISFORM.cntPPA.txtDtPrel.Value is a date type value, and not a string that must be converted into a date?
>>
>>When I move my mouse cursor over it it displays
>>{2021.03.01}
>
>Check with Vartype(), or even better, check in the debugger. And do the same for the other values.
Another proof that sometimes the FoxPro error message doesn't really tell what's really going on.
SELECT DATE (Ann_Fisc, Periode, Jour) AS DtFisc
That causes a problem when either Ann_Fisc, Periode or jour is equal to 0. In that case it won't be possible to create a column named DtFisc.
Now I'm wondering why it goes ok in the command window. Now I know why not in the app ;-)
*******************************************************
Save a tree, eat a beaver.
Denis Chassé