Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Date Problem Post Reply Post New Topic
Author Message
lw00
Newbie
Newbie
Avatar

Joined: 25 Sep 2008
Online Status: Offline
Posts: 14
Quote lw00 Replybullet Topic: Date Problem
     Posted: 11 Feb 2009 at 7:01pm
Hi guys,

I could have sworn I posted this thread already but I can't seem to find it. Sorry if this is a double post somehow.

I have a database which gets logged information every 5 minutes. I want to have a report that sums and displays the information every 15 minutes. So I would like information at 0,15,30,45 minutes. I wrote the if statement and it looks something like this:

if Minute({table.date}) <= 15 AND Minute({table.date}) >=5 then
   15
else if Minute({table.date}) <= 30 AND Minute({table.date}) >= 20 then
   30
else if Minute({table.date}) <= 45 AND Minute({table.date}) >= 35 then
   45
else if Minute({table.date}) = 50 OR Minute({table.date}) = 55 OR Minute({table.date}) = 0
   0

The above is what the group will be 'printed on any change of'. The number above are actually the date and time plus '15' or '30' as the minute display but it would be too long so I just put those.

I wanted to see 0,15,30,45 as the minute displays but now I'm seeing 15,30,45 and 55 as my displays. The sums are correct but the 55 is still displayed. I have a feeling this might be because 55 is the largest of 0,50 and 55 but I'm not sure? Does anyone have any suggestions?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 12 Feb 2009 at 6:28am
off hand, I don't see anything wrong...or least nothing that would give a result of 55 (other than the missing then at the end of the last if), but couldn't you just remove the last if all together?
 
just a thought, hope it helps
IP IP Logged
lw00
Newbie
Newbie
Avatar

Joined: 25 Sep 2008
Online Status: Offline
Posts: 14
Quote lw00 Replybullet Posted: 15 Feb 2009 at 7:28pm
mmmm.  ok. i'll take a closer look.  
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