Solved

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

Posted on 2013-12-06
2
652 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
ID: 39702564
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
ID: 39702654
That works, I made a formula for the weekstart and weekend.

thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 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