Solved

# Crystal - Return total weeks and current week - Fiscal Quarter

Posted on 2013-11-14
522 Views
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
Question by:kelsanit
• 4
• 2

LVL 100

Accepted Solution

mlmcc earned 500 total points
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

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

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

Author Comment

tried this formula and returned value of 1

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

Author Comment

I figured it out. had to out - had to use the following

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

fiscalpeirod start date: #9/29/2013#

0

LVL 100

Expert Comment

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

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…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.