Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Cannot summarize the field Post Reply Post New Topic
Author Message
tavche
Newbie
Newbie


Joined: 05 Jan 2011
Online Status: Offline
Posts: 9
Quote tavche Replybullet Topic: Cannot summarize the field
     Posted: 09 Jan 2011 at 3:42pm

 Can someone plz help? I am a newbie to crystal reports, so please explain in detail.

I have a report that has the following data
 

EpochBeginDate        EpochEndDate     timedifference1       AVAILVAL

2010

xyz

abc

09

9/20/2010 3:05:00PM 9/21/2010 10:30:00PM 1,885.00 0.00

9/21/2010 10:30:00PM 9/24/2010 10:15:00AM 3,585.00 1.00

9/24/2010 10:15:00AM 9/29/2010 4:50:00PM 7,595.00 0.00

9/29/2010 4:50:00PM 10/3/2010 9:55:00PM 1,869.98 1.00

10

9/29/2010 4:50:00PM 10/3/2010 9:55:00PM 4,195.00 1.00

10/3/2010 9:55:00PM 10/5/2010 9:45:00AM 2,150.00 0.00

10/5/2010 9:45:00AM 10/15/2010 11:50:00PM 15,245.00 1.00

10/15/2010 11:50:00PM 10/30/2010 7:00:00PM 21,310.00 0.00

10/30/2010 7:00:00PM 11/8/2010 2:05:00PM 1,739.98 1.00

11

10/30/2010 7:00:00PM 11/8/2010 2:05:00PM 10,925.00 1.00

11/8/2010 2:05:00PM 11/12/2010 1:35:00AM 5,010.00 0.00

11/12/2010 1:35:00AM 11/16/2010 4:35:00PM 6,660.00 1.00

11/16/2010 4:35:00PM 11/16/2010 5:40:00PM 65.00 0.00

11/16/2010 5:40:00PM 11/27/2010 9:55:00PM 16,095.00 1.00

11/27/2010 9:55:00PM 12/3/2010 5:45:00PM 4,444.98 0.00

12

11/27/2010 9:55:00PM 12/3/2010 5:45:00PM 3,945.00 0.00

12/3/2010 5:45:00PM 12/8/2010 10:10:00AM 6,745.00 1.00

12/8/2010 10:10:00AM 12/14/2010 7:50:00AM 8,500.00 0.00

12/14/2010 7:50:00AM 1/7/2011 11:55:00PM 25,449.98 1.00

abc

09

9/20/2010 3:05:00PM 9/24/2010 10:15:00AM 5,470.00 1.00

9/24/2010 10:15:00AM 9/29/2010 4:50:00PM 7,595.00 0.00

9/29/2010 4:50:00PM 10/3/2010 9:55:00PM 1,869.98 1.00

10

9/29/2010 4:50:00PM 10/3/2010 9:55:00PM 4,195.00 1.00

10/3/2010 9:55:00PM 10/5/2010 9:45:00AM   2,150.00            0.00

10/5/2010 9:45:00AM   10/15/2010 11:50:00PM 15,245.00      1.00

10/15/2010 11:50:00PM 10/30/2010 7:00:00PM 21,310.00       0.00

10/30/2010 7:00:00PM     11/8/2010 2:05:00PM 1,739.98         1.00

 I need the sum of timedifference for all 0's and 1's by group 'abc'
I can very well do a running total or insert summary, but it doesn't work,beacuse I guess it doesn't lie the way I calculated time difference
Timedifference formula:
IF MONTH({@EpochBeginDate}) = Month(DateTime (Date(DateAdd ('m' , 1 , {@EPOCHBEGINDATE} - day({@EPOCHBEGINDATE}) + 1) - 1)))
THEN
IF MONTH({@EpochBeginDate}) <>Month(DateTime (Date(DateAdd ('m' , 0 , {@EpochEndDate} - day({@EpochEndDate}) + 1))))
then
IF Month({@EpochEndDate})= Month (dateadd("m",+1,datetime(year({@BEGINDATE}), month({@BEGINDATE}),1,0,0,0)))
THEN
(
(DateDiff ('s',CDATETIME(1970,01,01,0,0,0),DateTime (Date(DateAdd ('m' , 1 , {@EPOCHBEGINDATE} - day({@EPOCHBEGINDATE}) + 1) - 1), CTIME (23, 59, 59))))-{@ReportStartTime})/60
ELSE
(
({@ReportEndDate}-(DateDiff ('s',CDATETIME(1970,01,01,0,0,0),DateTime (Date(DateAdd ('m' , 0 , {@EpochEndDate} - day({@EpochEndDate}) + 1))))
))/60)
ELSE
({@ReportEndDate}-{@ReportStartTime})/60;
 
 
 
Any other way to summarize all the timediffernces of 1's and 0's?
Any help appreciated.
 
 
Thanks


Edited by tavche - 09 Jan 2011 at 3:44pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jan 2011 at 6:52am
It is really hard to determine what you are doing here as the formula you are showing is referencing 5 other formulas that are not explained. I am guessing at least one of those formulas is using a previous() or next() function in it or another summary like Maxuimum().
IP IP Logged
tavche
Newbie
Newbie


Joined: 05 Jan 2011
Online Status: Offline
Posts: 9
Quote tavche Replybullet Posted: 12 Jan 2011 at 11:48am
Hi DBlank,
 
Thank you very much for your response. The issue within the timedifference formula is '({@BEGINDATE})' 
 My begin date formula is
 
numbervar x:= month({@EpochBeginDate});
numbervar y:= tonumber (GroupName ({Command.M}));
IF
month({@EpochBeginDate})<> y
THEN
DATETIME (DATE(DateAdd ('m' , -0 , {@EpochEndDate} - day({@EpochEndDate}) + 1)))
else
{@EpochBeginDate}
 
 
It did not like the fact that I was grouoping the month (Command.M) and using that to calculate Begin date. That's the reson running totals or summary field was not showing up for this formula and I was seeing an erro "This field cannot be summarized".
 
I apologize for being vague. I'll make sure I'll detail it out well next time.
 
I appreciate your response.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Jan 2011 at 4:25am
DId you get it worked out?
IP IP Logged
tavche
Newbie
Newbie


Joined: 05 Jan 2011
Online Status: Offline
Posts: 9
Quote tavche Replybullet Posted: 13 Jan 2011 at 4:40am
Yes. It worked when I replaced the Begin Date
with other formula that did not have grouping.
 
Thanks You!
 
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum