Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

about date ranges

Status
Not open for further replies.

qwertyu1

Technical User
Nov 1, 2006
57
US
hello all,

iam new to crystal reports.iam using crystal xi and oracle 9i.

i got table name like : fr_recon
and database field name :fr_recon.stand_exam_year(varchar4)

my question is:

i have to compare total recon made by <5yrs,5-10 yrs,10-15 yrs,15-20 yrs,20-30 yrs,>30 yrs based on current stand_exam_year.

i tried formula like :

if tonumber(fr_recon.stand_exam_year)=year(currentdate)
then count(fr_recon.stand_exam_year)

i got the total count for current year as 3440.
but i need to get totals for above years.

pls help me?

thanks.







 
Create a formula field that tests DateDiff in years between the currentdate and your date. Use the result to set a text value, maybe prefixed with things like a) <5yrs so you get the order you want.

Group using this field. Left-click & Insert for summary totals.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
sorry , i din't get you.

can u pls explain in clearly.what formula should i use for date diff?

 
hi all,

iam new to crystal reports.iam using crystal xi and oracle 9i.

i got table name like : fr_recon
and database field name :fr_recon.stand_exam_year(varchar4)

my question is:

i have to compare total recon made by <5yrs,5-10 yrs,10-15 yrs,15-20 yrs,20-30 yrs,>30 yrs based on current stand_exam_year.

i tried formula like :

if tonumber(fr_recon.stand_exam_year)=year(currentdate)
then count(fr_recon.stand_exam_year)

i got the total count for current year as 3440.
but i need to get totals for above years.

pls help me?

thanks.



 
Create a formula like:

if year(currentdate)-tonumber(fr_recon.stand_exam_year) < 5 then "<5yrs" else
if year(currentdate)-tonumber(fr_recon.stand_exam_year) in 5 to 10 then "5-9yrs" else
if year(currentdate)-tonumber(fr_recon.stand_exam_year) in 11 to 15 then "10-14yrs" else
//etc.

Insert a group on the above formula and then right click on a recurring detail level field and insert a count at the group level.

-LB
 
it's not working,

giveing error like 'then' missing
 
Please post the exact formula that you created.

-LB
 
this is the one

if year(currentdate)=tonumber{FR_RECON.STAND_EXAM_YEAR} < 5
then "<5yrs"
else
if year(currentdate)=tonumber{FR_RECON.STAND_EXAM_YEAR} in 5 to 10
then "5-9yrs"
else
if year(currentdate)=tonumber{FR_RECON.STAND_EXAM_YEAR} in 11 to 15
then "10-14yrs"
 
You have used equal signs instead of minus signs as intended.

-LB
 
wonderful

it's working, thanks for u r time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top