?
Solved

Crystal - Return total weeks and current week - Fiscal Quarter

Posted on 2013-11-14
6
Medium Priority
?
539 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 101

Accepted Solution

by:
mlmcc earned 2000 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 101

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

850 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