Symptom
- Need to create a report to return the Specific day of the month.
Environment
- Crystal Reports 2008
Resolution
- The best way would be to find the first Wednesday of the month and add 14 to that date.(Note : Instead of Wednesday you can take any day)
- Using the below mentioned formula, we can extract the first Wednesday.
- DateVar MonthStart;
DateVar FirstWed;
DateVar ThirdWed;
MonthStart := Date (Year (Today), Month (Today), 1);
DayOfWeek (MonthStart);
If DayOfWeek (MonthStart) = 4 Then //[Note: Here 4 indicates Wednesday, so monday=1,Tuesday=2 and so on]
ThirdWed := DateAdd ("d", 14, MonthStart)
Else If DayOfWeek (MonthStart) > 4 Then
(FirstWed := DateAdd ("d", (8 - Day (MonthStart)), MonthStart);
ThirdWed := DateAdd ("d", 14, FirstWed););
ThirdWed;
- DateVar MonthStart;
Keywords
Specific day of a month, Formula in Crystal Reports , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To
Product
Crystal Reports 2008 V1