Writing Code
 Crystal Reports Forum : Crystal Reports .NET 2003 : Writing Code
Message Icon Topic: Crystal report datetime display hourly Post Reply Post New Topic
Author Message
yasinirshad
Newbie
Newbie
Avatar

Joined: 24 Sep 2007
Location: Saudi Arabia
Online Status: Offline
Posts: 39
Quote yasinirshad Replybullet Topic: Crystal report datetime display hourly
    Posted: 20 Jul 2009 at 10:17pm

Hi,
I have a datetime field in sql db...for example with below values...

2009-05-18 01:00:00.000
2009-05-18 01:15:00.000
2009-05-18 01:30:00.000
2009-05-18 02:00:00.000

I want to display only those fields based on hourly values.. for example '2009-05-18 01:00:00.000' and '2009-05-18 02:00:00.000' from above example... I DONT WANT '2009-05-18 01:15:00.000' and '2009-05-18 01:30:00.000' to show in my report which has '15' ,'30','45' mins and so on... I want report to be sorted by every hour only.

How can I display this in crystal report 11 ..

Thanks to help.

Thanks,
Yasin.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 21 Jul 2009 at 2:02pm

Try using a formula instead of the field itself.  It will look something like this:

 
DateTimeValue(Year({table.datefield}), month({table.datefield}), 
  day({table.datefield}), hour({table.datefield}), 0, 0)
 
-Dell


Edited by hilfy - 21 Jul 2009 at 2:03pm
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.032 seconds.