?
Solved

Crystal - Return total weeks and current week - Fiscal Quarter

Posted on 2013-11-14
6
Medium Priority
?
536 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
[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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

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…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

801 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