How to get the Weekly or 7 days of the Date Range in Crystal Report -


How can I get 7 days or weekly in the formula areas of Crystal Reports? Example: March 01, 2014 to 31 March 2014 Date range: October 1 (March 01 to March 07) Week 2 (March 08 to March 14) Week 3 (March 15) March 21) Week 4 (March 22 to March 28) Week 5 (March 29 to 31 March)

Thanks,

Custom function RangeWeekSpitter Works within one year Crystal Syntax

  Function (Datetime Optimizer, Datetime, DTO) // The first day of the local date is the daytime dbagcurrr: = date (year (DFRM), 1, 1); // year (1 to 365 or 366 in a leap year) Local cluster nFrom: = dormant ("y", dFrom); Local cluster NTO: = datelists ("Y", DTO); Local class I ITo local area; Local node nDaysInWeek: = 7; // Number of days in local number local number: nyik: = 0; // counter week local stringVar sResult: = ""; // output string for i: n = n frame nTo step nDaysInWeek (nWeek: = nWeek + 1; iTo: = i + (nDaysInWeek-1); if (i + nDaysInWeek & gt; nTo) then iTo: = nTo ; Generate Output String sResult: = sResult + chr (13) + "Week" + CSRR + ("+ + CSRR" ("Y", "I", I-1, DBAGCURIIR), "MMMM D ") +" To "+ CST (dateaid (" Y ", ITO-1, DBAGCURear)," MMMM D ")" ");); sResult;   

Usage example:

  // date range local datetimeWefr: = date (2016, 1, 14); Local DateTime DTO: = Date (2016, 3, 4); RangeweekSplitator (DFRM, DTO);    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -