Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Aged from current date Post Reply Post New Topic
Author Message
Paula J
Groupie
Groupie
Avatar

Joined: 22 Aug 2011
Location: United States
Online Status: Offline
Posts: 51
Quote Paula J Replybullet Topic: Aged from current date
    Posted: 04 Mar 2013 at 6:42am
I created 6 formula one for 0-30 then 31-60, etc thru Over 150. I want the report to print the balance of an account in the correct bucket based on discharge date and then the other buckets report a 0.00.
 
My issue is if an account is over 150 days old the balance will result in all buckets vs just the last bucket.
if {PD_CDDPDRACCMAS_RECORD.CH_DIS_DT}>=currentdate-4000 to currentdate-151
then {PD_CDDPDRACCMAS_RECORD.CH_PT_DUE_AMT}
How it looks
Acct#   0-30    31-60  61-90  91-120  121-150  Over 150
11111  15.00  15.00  15.00   15.00     15.00      15.00
How I want it to look
Acct#   0-30  31-60  61-90  91-120  121-150  Over 150
111111  0.00  0.00  0.00     0.00       0.00        15.00
 
If an account is 93 days olf then the balance will result in 0-30,31-60,61-90 and 91-120 when I only want it to result in bucket 91-120.
if {PD_CDDPDRACCMAS_RECORD.CH_DIS_DT}>=currentdate-120 to currentdate-91
then {PD_CDDPDRACCMAS_RECORD.CH_PT_DUE_AMT}
 
 
How do I accomplish what I want?
Paula J
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Mar 2013 at 7:08am
you can use datediff() or agedXtoXdays functions
Not sure if you want the value to only show once per bucket for each instance. If so look at 6 formulas, each returns a number or a 0 if the vaue is outside the day range of the formula. Place each forula in the respective 'column'
//0to30
if {PD_CDDPDRACCMAS_RECORD.CH_DIS_DT} in Aged0To30Days
then {PD_CDDPDRACCMAS_RECORD.CH_PT_DUE_AMT}
 
//31to60
if {PD_CDDPDRACCMAS_RECORD.CH_DIS_DT} in Aged31To60Days
then {PD_CDDPDRACCMAS_RECORD.CH_PT_DUE_AMT}
 
//61to90
if {PD_CDDPDRACCMAS_RECORD.CH_DIS_DT} in Aged61to90Days
then {PD_CDDPDRACCMAS_RECORD.CH_PT_DUE_AMT}
 
 
//91to120
if datediff('d',{PD_CDDPDRACCMAS_RECORD.CH_DIS_DT},currentdate) in 91 to 120
then {PD_CDDPDRACCMAS_RECORD.CH_PT_DUE_AMT}
 
//121to1500
if datediff('d',{PD_CDDPDRACCMAS_RECORD.CH_DIS_DT},currentdate) in 121 to 150
then {PD_CDDPDRACCMAS_RECORD.CH_PT_DUE_AMT}
 
//Over150
if datediff('d',{PD_CDDPDRACCMAS_RECORD.CH_DIS_DT},currentdate) >150
then {PD_CDDPDRACCMAS_RECORD.CH_PT_DUE_AMT}
 
 
 


Edited by DBlank - 04 Mar 2013 at 7:09am
IP IP Logged
Paula J
Groupie
Groupie
Avatar

Joined: 22 Aug 2011
Location: United States
Online Status: Offline
Posts: 51
Quote Paula J Replybullet Posted: 04 Mar 2013 at 7:57am
This works...thanks!
Paula J
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.