Solved

Crystal Reports:  Date range modification for exact week day for Mon - Sun

Posted on 2013-12-06
2
641 Views
Last Modified: 2013-12-06
Experts,

I have a formula that gives me the date range for each week.  Weeks are considered as Monday through Sunday.  What I am trying to fix is when I run a report for LAST MONTH (November), the first week date range will begin on 10/28 to 11/03, which is Monday to Sunday.  I am trying to get it to show 11/01 to 11/03.  

Here is my current formula:

local datetimevar start;
local datetimevar end;
start:= {REPORTING_DATE}-weekday({REPORTING_DATE},2)+1;
End:=start+6;
totext(start,"MM/dd") & chr(10)&"to" & chr(10)&  totext(end, "MM/dd")


Thank you!
0
Comment
Question by:Maliki Hassani
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
When do you want to change the start date of a week?

How are you selecting the data?
Are you selecting the data in last month or is there some other formula?

What about the last week of the month?

If you want to show the first week of a month as always starting on the first it can be done by

If (Month(WeekStart) <> Month(WeekEnd) then
   Start := Date(Year(WeekEnd),Month(WeekEnd),1)


mlmcc
0
 

Author Comment

by:Maliki Hassani
Comment Utility
That works, I made a formula for the weekstart and weekend.

thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now