Wednesday, July 31, 2013

Crystal Reports : Age Calculations

One of the many things you will want to do with a bona-fide date field is calculate age.
Crystal makes it easy for us here; as long as we're comparing two date type fields, we can perform simple math.
Let us suppose that the date field in question is {CONTACTS.SOURCEDATE}, which represents when a particular prospect was imported into our database.

1. We can see how many records were imported in the last seven days

{CONTACTS.SOURCEDATE} <= CurrentDate() - 7

2. Or how "old" any particular record is, expressed in days

CurrentDate() - {CONTACTS.SOURCEDATE}

3. To calculate the age in years, we must use the Crystal DateDiff function:

DateDiff("yyyy", {CONTACTS.SOURCEDATE}, CurrentDate())

The "yyyy" specifies we want the answer in years; "m" and "d" are also options (months and days, correspondingly)

1 comment:

Jeffer Shen said...

For instance all of sponsorship/endorsement promotions to get look at companies for instance Hublot, its pertaining to omega replica watches view plus knowledge. Hublot but not only prefers being a advisable solution for any most people who seem to have fun with activities for instance chanel replica sale on line poker "professionally" moreover the variety of admirers plus recreational on line poker game enthusiasts. Hublot carries with it an tag heuer replica uk affinity for relating it has the name brand by using exercises when specific plus aspirational deluxe individuals shell out its time frame plus particular attention. Another thing, on line poker has become a substantial viewer sport activity. The modern world On line poker Tour's incidents will be televised plus deemed by way of many. Remarkably more than enough, on line poker is already viewed as your rolex replica sale method of "sport, inches plus exhibit for options just like Sibel Physical activities. Hublot is definitely earning a rado replica uk eyes with all the self-proclaimed folks that invest some time right after on line poker incidents : and that is certainly your succeed for your make this depends upon showing off. We will enter into long issue to the benefits to be obvious in regards to showcasing deluxe solutions.