• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

Crystal Reports - Need to Add date to the 1st Monday of the week

I am using a group to organize my expenses by week. My week goes from Monday to Sunday. This formula works great for grouping the data. But I need to add a date for the 1st or last day of the week.
Group Formula - DatePart ("ww",{Cornerstone_Solutions.Date},CrMonday)

Example May 13 (Monday) and May 19 (Last day of my week).

I would like May 13-19, 2013 to appear on the report in the Group Header #1. Currenly all I get is "20" because May 13-19 is the 20th week of the year I am guessing.

Any suggestions?
0
D_Bjerke
Asked:
D_Bjerke
  • 2
1 Solution
 
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Get the Day of the Week number, and subtract or add days accordingly to get the Monday or Saturday.
0
 
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
For example, using CurrentDate instead of the dates in your database:

ToText(Currentdate - (DayOfWeek(Currentdate) - 2)) & " - " & ToText(Currentdate - (DayOfWeek(Currentdate) - 8))
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now