Solved

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

Posted on 2013-05-20
4
314 Views
Last Modified: 2013-09-02
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
Comment
Question by:D_Bjerke
  • 2
4 Comments
 
LVL 22

Expert Comment

by:Ido Millet
ID: 39182913
Get the Day of the Week number, and subtract or add days accordingly to get the Monday or Saturday.
0
 
LVL 22

Accepted Solution

by:
Ido Millet earned 500 total points
ID: 39182925
For example, using CurrentDate instead of the dates in your database:

ToText(Currentdate - (DayOfWeek(Currentdate) - 2)) & " - " & ToText(Currentdate - (DayOfWeek(Currentdate) - 8))
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question