Print Page | Close Window

Calculate Avg Difference in Days by Month

Printed From: Crystal Reports Book
Category: General Information
Forum Name: Announcements
Forum Discription: Please check this section for the latest announcements from Crystal Reports Forum
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1660
Printed Date: 28 Apr 2024 at 7:09pm


Topic: Calculate Avg Difference in Days by Month
Posted By: reportwriter
Subject: Calculate Avg Difference in Days by Month
Date Posted: 09 Nov 2007 at 1:33pm

How would I calculate and report the average difference in the number of days (between the beginning and end dates) by Month?  Data is averaged and reported by the end_date's month.

If I have this type of data:

begin_date   end_date
1/14/2007    2/6/2007
2/1/2007      4/2/2007
2/1/2007      2/28/2007
3/1/2007      3/25/2007

The difference “in days” for each record and the reporting month are:
Record 1            23            reported in “Feb”
Record 2            60            reported in “Apr”
Record 3            27            reported in “Feb”
Record 4            24            reported in “Mar”

The result of the crystal report should be:

Jan    Feb    Mar    Apr
0        25      24     60

I am new to Crystal Reports and pseudo code would help me get started.

Thank you for your help!

Pat



-------------
Pat



Print Page | Close Window