Author |
Message |
jjjb
Newbie
Joined: 10 Aug 2009
Online Status: Offline
Posts: 13
|
Topic: aging reports Posted: 10 Aug 2009 at 3:30pm |
hello,
Can someone tell me how we can create a function/formula to show an aging for 15 to 30? i know crystal comes with age0to30days, and greater, but nothing less than that.
if anyone can help i would appreciated, thanks!
|
IP Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
|
Posted: 11 Aug 2009 at 6:29am |
local numbervar daysAged:=datediff(d,{itemdate},{agingdate});
if daysAged >=15 and daysAged<=30 then
...(usually aged amount)
I end up building my own variables to hold the amounts that fall into the buckets for aging. Ends up having lots of shared variables (for each bucket/for each group) and lots of formulas to display and increment the variables. A good naming convention will help
HTH
|
IP Logged |
|
jjjb
Newbie
Joined: 10 Aug 2009
Online Status: Offline
Posts: 13
|
Posted: 11 Aug 2009 at 9:05am |
hi, thanks for the quick response but im new to programming in crystal.
where exactly do we put that information into? can we just put it under the formula workshop?
i looked up the datediff and im not sure how it works. can the parameter be anything we enter or does it need to be a database field?
essentially, the company i work for requires payment of their invoice within 2 weeks. as for the dates,
can i use the current_date, and the invoice_date? as their parameters to run the report?
i noticed you created two variables, the item_date and aging_date. could i replace them with the current_date, and the invoice_date?
thanks again!
|
IP Logged |
|
KAIBIRO
Newbie
Joined: 11 Aug 2009
Location: Canada
Online Status: Offline
Posts: 5
|
Posted: 11 Aug 2009 at 9:27am |
Hi Newbie,
// The following formula can help:
if {database field} in dateadd("d",-30,{?AsOfDate}) to dateadd("d",-15,{?AsOfDate}) then {database field} else 0
//the database field is any field in the database. abd the ?AsofDate is a date parameter you can create to select a date from
Thanks,
|
kaib
|
IP Logged |
|
jjjb
Newbie
Joined: 10 Aug 2009
Online Status: Offline
Posts: 13
|
Posted: 11 Aug 2009 at 9:35am |
thanks for that;
couldnt we replace asofdate with currentdate? this report will be run everyday.
|
IP Logged |
|
KAIBIRO
Newbie
Joined: 11 Aug 2009
Location: Canada
Online Status: Offline
Posts: 5
|
Posted: 11 Aug 2009 at 9:55am |
Sure you can do that.
|
kaib
|
IP Logged |
|
jjjb
Newbie
Joined: 10 Aug 2009
Online Status: Offline
Posts: 13
|
Posted: 11 Aug 2009 at 10:33am |
thank you guys..
any suggestions on where i can go learn some of this stuff on my own?? i mainly use crystal report to run reports using the expert selection. all this programing stuff looks cool ..
thanks again.
|
IP Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
|
Posted: 11 Aug 2009 at 11:54am |
book I like best is Brian's.
I was just using some sample ideas, as you found out, you could use today's date...my agings tend to be not necessarily as of today--an asOfDate. It is all a matter of how you want to populate your buckets, and how many you have.
Glad you found an answer.
|
IP Logged |
|
|