Monday, October 26, 2015

Crystal Reports : Calculating Age

ne 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)

3 comments:

PLC training in chennai said...

WIZTECH Automation, Anna Nagar, Chennai, has earned reputation offering the best automation training in Chennai in the field of industrial automation. Flexible timings, hands-on-experience, 100% practical. The candidates are given enhanced job oriented practical training in all major brands of PLCs (AB, Keyence, ABB, GE-FANUC, OMRON, DELTA, SIEMENS, MITSUBISHI, SCHNEIDER, and MESSUNG)

PLC training in chennai
Automation training in chennai
Best plc training in chennai
PLC SCADA training in chennai
Process automation training in chennai
Final year eee projects in chennai
VLSI training in chennai

Zheng junxai5 said...

zhengjx20160623
nike blazers uk
jordan shoes
michael kors purses
air jordan femme
kobe shoes 11
louis vuitton outlet
nike trainers sale
ray ban sunglasses outlet
michael kors outlet online
cheap oakley sunglasses
celine bags
toms wedges
michael kors outlet clearance
cheap jerseys
nike air max
coach outlet
louis vuitton handbags
rolex watches
louis vuitton purses
cheap air jordans
cheap basketball shoes
christian louboutin sale clearance
adidas factory outlet
adidas outlet store
rolex watches
hollister clothing
cheap jordans
hollister jeans
toms shoes
michael kors outlet online
coach factory outlet
beats by dr dre
nike roshe run
true religion outlet online
air jordan shoes
jordan 3s
montblanc pen
ralph lauren
cheap oakleys
ed hardy outlet

Meiqing Xu said...

ugg outlet store
canada goose
moncler outlet
converse trainers
louboutin shoes
red bottoms
jerseys wholesale
canada goose
christian louboutin
nike cortez
20161209caiyan