Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-12-06
2
Medium Priority
?
659 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

715 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