The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss reports for SalesLogix including Crystal, SQL Reports, etc. View the code of conduct for posting guidelines.
|
|
|
|
Crystal Report and Networkdays
Posted: 29 Nov 06 4:39 PM
|
fiogf49gjkf0d I know this works in excel but how do you do a networkdays calculation in CR 8.5. I need to do a calculation between a start date and end date using just M-F.
Thanks for your expertise.
Kim |
|
|
|
Re: Crystal Report and Networkdays
Posted: 30 Nov 06 6:23 AM
|
fiogf49gjkf0d Kim,
The quick answer seems to be there is no CR 8.5 equivalent of the Excel networkdays function.
Can you clarify if you are just trying to count the number of weekdays (M-F) between two dates or are you trying to do a calculation only for weekdays between two date, for example the SUM of price.
If there is no CR 8.5 equivalent of the Excel funtion then I'd have to say you are going to have to create a formula of some sort to accomplish the same thing. There is a DayofWeek() function that tell you what day of the week a date it (Sun=1, Mon=2, etc..)
John G. |
|
|
|
Re: Crystal Report and Networkdays
Posted: 30 Nov 06 2:51 PM
|
fiogf49gjkf0d Hi Kim,
Use the Date Diff Function in crystal to get what you're after.
You can use the “ww” argument in the DateDiff function to count the number of a day occurrences. DateDiff ( “measurement”, “start date”, “end Date”, “firstDayofWeek”). The first day of week argument is only available with the “ww” argument. So DateDiff ( “ww”, #4/2/2006# , #4/9/2006#, crSunday) will count the number of Sunday’s in that date range. (keep in mind, date diff ignores the start day in the range count so that formula will return 1 and DateDiff ( “d” ,#4/2/2006#, #4/9/2006#) will return 7 instead of 8). So the end result for the formula was
Formula = DateDiff ( “d” , Start Date, End Date) - DateDiff ( “ww” , Start Date, End Date, crSaturday) - DateDiff ( “ww” , Start Date, End Date, crSunday)
I hope that helps! |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|