Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Caculate days btw two dates Post Reply Post New Topic
Author Message
crystal2012
Newbie
Newbie


Joined: 17 Apr 2012
Online Status: Offline
Posts: 36
Quote crystal2012 Replybullet Topic: Caculate days btw two dates
     Posted: 19 Apr 2012 at 8:51am
I want to get total days btw current date and a database field that is defined as date. it's very simple to do it in sql (value(days(current date), 0) - vlaue(dbfield), 0). How to create a formula to do the job? Thanks!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Apr 2012 at 9:00am

basically the same as in sql using datediff

datediff('d',{table.field},currentdate)
 
or flip the dates depending on which direction your db field is (future or past)
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