// Initialize variables FromDate :=010107D; ToDate :=TODAY; Amount := 0; TotalAmount := 0; CurrAccTotal := 0; ContMonth := ''; MonthContAmount := 0; // Variable initialization ends above. // Code to Get Previous Contributionsributions ContributionsOld.SETRANGE("Employee No.",Empid); ContributionsOld.SETRANGE("From Date",FromDate,ToDate); ContributionsOld.SETFILTER("From Date",'<%1',FromDate); ContributionsOld.SETFILTER("To Date",'<%1',ToDate); // Code Ends Above. IF ContributionsOld.FIND('-') THEN BEGIN OldAmount := ContributionsOld.Quantity; IF ContributionsOld.NEXT <> 0 THEN REPEAT OldAmount := OldAmount + ContributionsOld.Quantity; UNTIL ContributionsOld.NEXT = 0; END; Cont.SETRANGE("Employee No.",Empid); Cont.SETRANGE("From Date",FromDate,ToDate); Cont.SETFILTER("From Date",'>=%1',FromDate); Cont.SETFILTER("To Date",'<=%1',ToDate); IF Cont.FIND('-') THEN BEGIN TotalAmount := Cont.Quantity; ContMonth := FORMAT(Contributions."To Date",0,'<Month Text>, <Year4>'); Months := Cont.COUNT; IF Cont.NEXT <> 0 THEN REPEAT TotalAmount := TotalAmount + Cont.Quantity; UNTIL Cont.NEXT = 0; END; //Formatting Months Below ContMonth := FORMAT(Contributions."To Date",0,'<Month Text>, <Year4>'); MonthContAmount := Contributions.Quantity; EndDate := FORMAT(ToDate,0,'<Day> <Month Text>, <Year4>'); BeginDate := FORMAT(FromDate,0,'<Day> <Month Text>, <Year4>'); // Formatting Ends above line.ContMonth display the months.
Comments
You could do something with the Date table
Date data item with filters for your date range
Values you want to check for that date
My Blog - nav.education
Any idea?
Thanks