ISTech Support Forum
http://www.istechforum.com/YaBB.pl
Crystal Reports, ODBC & Access >> Crystal Reports General Issues >> Formula Needed
http://www.istechforum.com/YaBB.pl?num=1171394541

Message started by Tim Keating on 02/13/07 at 11:22:21

Title: Formula Needed
Post by Tim Keating on 02/13/07 at 11:22:21

I'm writing an aging report that will accomodate PROX terms and wonder if anyone could help with a formula.

For a given invoice date, I'd like a formula to return the date for, say, the 25th of the next month.

Title: Re: Formula Needed
Post by kevind on 02/13/07 at 12:11:16

Would this work for you?


date( year(dateadd("m", 1, {BKARINV.BKAR_INV_INVDTE})),
     month(dateadd("m", 1, {BKARINV.BKAR_INV_INVDTE})),
     25);


Title: Re: Formula Needed
Post by Tim Keating on 02/13/07 at 12:34:07

Looks good, except it won't wrap to the next year properly.

I think I can work with it though.

Thank you.

Title: Re: Formula Needed
Post by kevind on 02/13/07 at 12:37:10

I saw that after I posted  :o

I corrected it above.  Sorry   :-[


Title: Re: Formula Needed
Post by Tim Keating on 02/13/07 at 12:37:58

I've been kicking this little gem around:

date(Year(dateadd('m',{@ProxMo},datetime({BKARINVT.BKAR_INVT_DATE}))),month(dateadd('m',{@ProxMo},datetime({BKARINVT.BKAR_INVT_DATE}))),25)

The @ProxMo formula determines whether to advance one month or two, depending on the invoice date:

if day({BKARINVT.BKAR_INVT_DATE}) < 25 then 1 else 2

I've got to learn how to use declared variables.

Title: Re: Formula Needed
Post by Tim Keating on 02/13/07 at 12:39:21

Thanks, Kevin.

Your edited formula will work for me.

ISTech Support Forum » Powered by YaBB 2.1!
YaBB © 2000-2005. All Rights Reserved.