Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Date formula Post Reply Post New Topic
Author Message
nabbage
Newbie
Newbie


Joined: 19 Feb 2008
Location: United States
Online Status: Offline
Posts: 1
Quote nabbage Replybullet Topic: Date formula
     Posted: 19 Feb 2008 at 1:07pm
Hi,  I am fairly new to writing crystal reports and I am stuck on an item.  I work for a membership organization and we're trying to track anniversary date of our members (those who have joined 0-3 years ago, 3-5 years ago, 5-10 years ago, and 10+ years ago).
 
I want the report to display join.dates in the columns listed above:  0-3 years, 3-5 years, 5-10 years, and 10+ years in comparison to CurrentDate.  I have set up the inital report and want to use four running totals for the above date ranges, but create a condition formula to calculate the date ranges in comparison to CurrentDate.
 
Any ideas on what these formulas might look like?  I've been racking my brain all afternoon and haven't come up with anything that will work. Angry
 
Any help would be greatly appreciated.  Thank you.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 19 Feb 2008 at 5:09pm
I would do something like using the Choose() function to assign an group number based on how many years difference there is. Then group on the group number. Something like this:
Choose(Year(Now)-Year({field}, 1,1,1,2,2,2,3,3,3,3,3,4)

I have all the Crystal Report functions documented in Chapter 7 of my book 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>
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