Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Finding Difference between two times Post Reply Post New Topic
Author Message
aeckaren
Newbie
Newbie
Avatar

Joined: 24 Jul 2012
Online Status: Offline
Posts: 26
Quote aeckaren Replybullet Topic: Finding Difference between two times
    Posted: 22 Jan 2015 at 10:21am
I need to find the difference between two times. I'm pretty sure the formula should be:

datediff("n",{currenttime},{datatime})

I keep getting the message "A Date is Required Here" while highlighting my time fields. What am I missing here?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 22 Jan 2015 at 12:33pm
Make sure that both fields are indeed date fields.  There is a built in function called CurrentDateTime and thus your formula would change to datediff("n",CurrentDateTime,{datatime}) if you wanted to use that function.
IP IP Logged
aeckaren
Newbie
Newbie
Avatar

Joined: 24 Jul 2012
Online Status: Offline
Posts: 26
Quote aeckaren Replybullet Posted: 23 Jan 2015 at 4:55am
Thanks for the help. That was the problem...the fields were time fields but not date fields. When I changed them to datetime fields, the formula worked.
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.023 seconds.