"The value of COPYSTR parameter 3 is outside of the permitted range.

Check the Date value by adding

Message(’%1’,VarText);

SepPos := STRPOS(VarText,’-’);

and write

IF SepPos <> 0 THEN

COPYSTR code here

Regional settings ? Are those the same? Are you running the process from the same coputer againts two db’s ?

g.

Hey i have solution for this…

your code:

SepPos := STRPOS(VarText,’-’);
txtYear := COPYSTR(VarText,1,(SepPos - 1));
IF NOT TextToInteger(Year, txtYear) THEN EXIT(FALSE);

My Code:

clear(seppos);

SepPos := STRPOS(VarText,’-’);

if SepPos <>0 then
txtYear := COPYSTR(VarText,1,(SepPos - 1));

else

txtyear := vartext;

IF NOT TextToInteger(Year, txtYear) THEN EXIT(FALSE);

try my code… because if it does not find ‘-’ character u shud not end up copying from 1 to -1…

It works!

Anil.

Hi Elisa,

Did you get an answer to your question? Did it help you? The members and moderators here on DUG use our spare time and help you for free, all we ask in return is that you spent a few seconds to let us know if we helped you solve your problem.

If any of the suggestions helped you solve your question/problem, then please click the “Verify Solution” on the answer that helped you, so that we can see that your problem is now “resolved”. Otherwise let us know how if there is something else you like to know.

Have a nice day! [:)]