Solved

Crystal - Return total weeks and current week - Fiscal Quarter

Posted on 2013-11-14
6
531 Views
Last Modified: 2013-11-14
Need some help with the following:

I need to return the total weeks for a given fiscal period and the current week

example: Fiscal period 3  (9/29/2013 - 12/28/2013)

Total Weeks:  13
Current week: 6

I will have a formula in the report that will list the fiscal period quarter dates:

example:

Fiscal period 1: 3/31/2013 - 6/29/2013
Fiscal period 2: 6/30/2013 - 9/28/2013
Fiscal period 3: 9/29/2013 - 12/28/2013
Fiscal period 4:  12/29/2014-3/29/2014
0
Comment
Question by:kelsanit
  • 4
  • 2
6 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39648823
I don't know how you are determining the fiscal periods but you can get the weeks with this.  It will always be 13 unless they mess up the dates

DateDiff("ww",{Fiscal Period start},{Fiscal Period End}+1)

Similarly for this week

DateDiff("ww",{Fiscal Period start},Today)

mlmcc
0
 

Author Comment

by:kelsanit
ID: 39648869
yes, you are correct. There will also be a total of 13 weeks. So how do I determine the current week I am in. They only way I have to pull date is using formula for current date.
0
 

Author Comment

by:kelsanit
ID: 39648887
I tried this formula and got the following

DateDiff("ww", date (9/29/2013) ,Today)

returned 5942

I am wanting it to return 6
0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 

Author Comment

by:kelsanit
ID: 39648895
tried this formula and returned value of 1

DateDiff("ww", date (9/29/2013), date(12/28/2013)+1)
0
 

Author Comment

by:kelsanit
ID: 39648932
I figured it out. had to out - had to use the following

DateDiff("ww", {@FiscalPeriod_StartDate} ,currentdate)


fiscalpeirod start date: #9/29/2013#

thank you for your help.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39649448
The Date function expects to see 3 numbers for the Year, month, day or a string in the form of April 23, 2013 or a date/datetime field from the database

mlmcc
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delete the first occurence of a duplicate row in sql 5 41
Stored Proc - Rewrite 42 70
SQL Query help 3 24
SQL Syntax 6 27
In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 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