Friday, August 31, 2012

Crystal Reports : Age and Date Math

Yes, this old chestnut never stops being useful;

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)

Note: In order for Date Math to work correctly, all evaluated fields MUST be Date Types. Otherwise they must first be converted to Date Types using a Crystal Function like CDATE(). 

3 comments:

Muhammad Amir said...

I wanted to give poor help me with math beleaguered Barbie a high five and say to her, “Rock on, sister, with your bad math self.

Anonymous said...

We accomplish our own absolute replica so we baby-sit the assembly of anniversary handmade item.Anniversary account is inspected afore addition to ensure the accomplished superior replica watches standards.However,afore affairs a accurate watch or broad jewelry,you should analysis if the agent is accouterment you with high-quality and accurate product.Some time ago of added than 150 years,they charge won a ample amount of continues and put calm abundant aspect for the absolute watch industry.If the amount is same,one with dior replica acceptable superior not alone looks acceptable in appearance and shape,but aswell feels abundant inside.On the contrary,one with bad superior may just attending OK at the aboriginal sight,but can't angle the analysis of a additional sight.You can get a replica backpack through assorted ways,article food louis vuitton replica or online.Handbags are an capital appearance accent for women.They do not alone accompaniment their outfit,but they are aswell an announcement of their personality.This is the acumen why women are actual specific if allotment their own handbags.Chanel handbags are one of the a lot of gucci replica advantaged artist handbags today.Unfortunately,their top amount makes it akin for the boilerplate customer to afford.Instead,abounding humans just achieve for beneath than the dream artist bag that they've consistently capital to have.

m vivi said...

Affordable handbags are needed extras for ladies plus the majority of would like to shell out quite a lot of capital for any perfect creator travelling bag. replica cartier Having said that, you cannot assume all gals have enough money for up to date Birkin travelling bag and also Prada designer purse, its no wonder that a lot of them find replacement affordable handbags, which will simply depict a low-priced release of your way too highly-priced creator accessories. fake chanel coco When top rated design music labels started to style and design plus make affordable handbags who were progressively more highly-priced, fake prada a lot of them boasting overpriced points, just like yellow metal seals and also Swarovski deposits or even just serious diamond rings inlaid while in the set, a large wide variety of gals going to get more and many more attracted to is an excellent creator reproductions of vintage designs. cartier replica uk Due to this fact, this marketplace to get low-priced replacement affordable handbags includes expended a great deal plus nowadays there are lots of solutions that come with women of all ages a chance to look to get superb wanting accessories plus baggage during really acceptable selling prices, rolex submariner replica unquestionably considerably inexpensive versus the originals.
tiuhas