Tuesday, April 26, 2016

Crystal Reports : Date Math

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)

4 comments:

Bogdan Yanov said...

Great informative site. I'm really impressed awriter.org
after reading this blog post. I really appreciate the time and effort you spend to share this with us! I do hope to read more updates from you.

Hua Cai said...

cartier watches
cheap soccer jerseys
louis vuitton pas cher
hollister clothing
tiffany jewellery
christian louboutin uk
replica watches
louis vuitton bags cheap
true religion jeans
polo ralph lauren
fred perry polo
nike roshe run
ray ban sunglasses
hollister
christian louboutin shoes
snapbacks wholesale
police sunglasses for men
michael kors outlet clearance
true religion outlet
nike blazer pas cher
coach outlet clearance
true religion jeans
ghd hair straighteners
celine outlet online
abercrombie outlet
chrome hearts
mulberry bags
lululemon outlet
rolex uk
prada handbags
cheap football shirts
louis vuitton bags
ralph lauren polo
tods outlet online
ralph lauren outlet
20160716caihuali

Fangyaya said...

cheap uggs
jordan retro 8
rolex watches for sale
boston celtics jerseys
ray ban sunglasses
abercrombie outlet
coach outlet
ugg boots paris
louis vuitton purses
coach outlet online
gucci handbags
toms shoes uk
retro jordans 13
michael kors outlet
ghd flat iron
cartier watches outlet
air jordan shoes
coach outlet
coach outlet store online
gucci handbags
michael kors uk
ray ban sunglasses outlet
ed hardy outlet
air jordan femme
canada goose coats
louis vuitton outlet
christian louboutin outlet
gucci outlet
coach outlet online
coach outlet
clarisonic
cheap true religion jeans
discount jordans
michael kors outlet
polo outlet
ralph lauren sale
michael kors outlet clearance
moncler doudoune
canada goose uk
lebron james shoes 13
20168.13chenjinyan

caiyan said...

birkenstock sandals
nike air force 1
valentino
hugo boss
oakley sunglasses
ray ban eyeglasses
ugg boots
canada goose
uggs on sale
michael kors outlet
20161018caiyan