SET STRICTDATE TO [0 | 1 | 2] && m.a=thisform.text2.value m.d=thisform.text1.value GOMONTH({^m.d},- thisform.text2.value)&&the same error message thisform.text3.value=GOMONTH DELETE FROM allres WHERE EXISTS(SELECT * FROM allresdintial WHERE clint_no=allres.clint_no and allresdintial.dat>=m.g)&&>Maybe check the value of SET("STRICTDATE") in your program & see if you either want to change the value of that, or change the code to acccomodate your current STRICTDATE setting. This value can also be adjusted in your development environment under Tools-->Options-->General.
>>m.a=thisform.text2.value >>m.d=thisform.text1.value >>GOMONTH({^m.d}, -m.a) >> thisform.text3.value=GOMONTH >> >>**&&& no need for IF && I think >>m.g=thisform.text3.value >>DELETE FROM allres WHERE EXISTS(SELECT * FROM allresdintial WHERE clint_no=allres.clint_no and allresdintial.dat>=m.g)&& >> >>>>thanks.
>>>> thisform.text1.value=05/06/2006 >>>>if thisform.text2.value=3 >>>> thisform.text3.value=thisform.text1.value-3 months && result as 05/03/2006 >>>> >>>>DELETE FROM allres WHERE EXISTS(SELECT * FROM allresdintial WHERE clint_no=allres.clint_no and allresdintial.dat>=thisform.text3.value) >>>> >>>> >>>>if thisform.text2.value=6 >>>> thisform.text3.value=thisform.text1.value-6 months && result as >>>>DELETE FROM allres WHERE EXISTS(SELECT * FROM allresdintial WHERE clint_no=allres.clint_no and allresdintial.dat>=thisform.text3.value) >>>> >>>> >>>>if thisform.text2.value=9 >>>> thisform.text3.value=thisform.text1.value-9 months && result as >>>>DELETE FROM allres WHERE EXISTS(SELECT * FROM allresdintial WHERE clint_no=allres.clint_no and allresdintial.dat>=thisform.text3.value) >>>> >>>>if thisform.text2.value=12 >>>> thisform.text3.value=thisform.text1.value-12 months && result as >>>> >>>>DELETE FROM allres WHERE EXISTS(SELECT * FROM allresdintial WHERE clint_no=allres.clint_no and allresdintial.dat>=thisform.text3.value) >>>>>>>>