Thursday, June 26, 2014

Crystal Reports : Age Calculation

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)

2 comments:

Hermes iPhone 6 plus case said...

Apple itself makes some of the most amazing software on the planet, and few apps are as powerful as Apple’s iMovie. With iMovie and an iPhone anybody can record, edit and share amazingly creative home movies.

lin liyi said...

Glenohumeral joint hublot replica sale inside normal buckskin supply a quick and easy style for the many laid-back garments. Looking for in which cutting-edge style and design, next determine any any glenohumeral joint bag carrier together with stud shows and also website link sequence outlining. Regarding fake rolex for sale moment around the boat or perhaps for anyone laid-back trips as compared to dog models is likely to make a satisfying alternative to enhance your own personal number of bag hand bags. Require a hublot replica uk around the outrageous part together with competition to be able to snakeskin models. Determine the right bag regarding enterprise to make certain it is possible to really luster simply by deciding on any modern fake dior using a sound shade structure layout. Many individuals have even to be able to look for the particular bag merchandise from other favored artist in another country only for doing their particular bag assortment. Today, getting artist bags will probably be no problem finding creating an online business help. Folks don't need to abandon their property in any way to obtain the hublot replica together with certain layout and even constrained model from the comfort of their property.