Solved

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

Posted on 2013-12-06
2
648 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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