Print Page | Close Window

How to find difference between two dates

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=2401
Printed Date: 30 Apr 2024 at 5:56pm


Topic: How to find difference between two dates
Posted By: anbu
Subject: How to find difference between two dates
Date Posted: 21 Feb 2008 at 8:33am
Hello thre,

I am in the hunt of getting a correct formula to calculate the difference between two dates. does anyone out there know about it? the logic is to find 'if the diference  between two dates is more then two years or less?' Any idea will be helpful.

Cheers!



Replies:
Posted By: BrianBischof
Date Posted: 21 Feb 2008 at 6:09pm
Use the DateDiff() function. The first paramter is the interval ("d" for days or "yyyy" for years) and the next two parameters are the dates you want to work with.

I discuss the date functions in Chapter 6 of my book http://www.amazon.com/exec/obidos/ASIN/0974953601/bischofsystem-20 - Crystal Reports Encyclopedia .

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window