*get the date of taxrate SELECT; MAX(cur2.Effdate) AS Effdate,; cur1.billdate; FROM schild AS cur1; INNER JOIN taxmaster AS cur2; ON cur1.billdate=>cur2.Effdate; INTO CURSOR curHelp; GROUP BY 2 *get the taxrate for a day *two steps for VFP 9.0 SELECT ; cur1.billdate,; cur2.taxrate; FROM curHelp AS cur1; INNER JOIN taxmaster AS cur2; ON cur1.Effdate=cur2.Effdate; INTO CURSOR curHelp *write the taxrate back INDEX ON billdate TAG billdate SELECT schild SET RELATION TO billdate INTO curHelp REPLACE; taxrate WITH curHelp.taxrate; ALL *clean up SET RELATION TO USE IN curHelpAgnes
> >Effdate d && effective date >taxrate n(5,2) && tax rate > >records in taxmaster.dbf && no of records can change in taxmaster.dbf > >Effdate Taxrate >01.04.2007 0.00 >15.06.2007 4.00 >01.07.2007 12.50 > > > > >schild.dbf have 6 fileds && more than 5000 records with diffrent billdates. > >billdate d >billno c(8) >product c(50) >quantity n(10,3) >rate n(10,2) >taxrate n(5,2) > > >billdate billno product quantity rate taxrate >02.04.2007 001001 abc 5 500.00 ?? should be 0.00 >03.04.2007 001001 abc 5 500.00 ?? should be 0.00 >04.04.2007 001001 abc 5 500.00 ?? should be 0.00 >05.05.2007 001001 abc 5 500.00 ?? should be 0.00 >04.06.2007 001001 abc 5 500.00 ?? should be 4.00 >05.06.2007 001001 abc 5 500.00 ?? should be 4.00 >08.06.2007 001001 abc 5 500.00 ?? should be 4.00 >10.07.2007 001001 abc 5 500.00 ?? should be 12.50 >12.07.2007 001001 abc 5 500.00 ?? should be 12.50 >18.07.2007 001001 abc 5 500.00 ?? should be 12.50 >21.07.2007 001001 abc 5 500.00 ?? should be 12.50 >25.07.2007 001001 abc 5 500.00 ?? should be 12.50 > > >>