Author |
Message |
benner
Newbie
Joined: 18 Mar 2010
Online Status: Offline
Posts: 23
|
Posted: 18 Mar 2010 at 10:52am |
We don't always necessarily have just two rows. Might be more based on hom many sp payments the patient makes. Here is my formula...I'm getting zero's when I use the min...if i use max it works but I really want the min on the sp part as some patient's make multiple self pay pmts...so I want first sp payment date that is posted.
datediff('d',(Maximum ( {@Ins Pymnt date}, {DS_ENCOUNTER_PAYMENTS.ENCOUNTER_NUMBER})), (Minimum ( {@SP Pymnt date}, {DS_ENCOUNTER_PAYMENTS.ENCOUNTER_NUMBER})))
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 18 Mar 2010 at 11:38am |
try changing your formula to throw in a large future date on the else when it is an SP type...
sp payment formula to:
if {DS_ENCOUNTER_PAYMENTS.INSURANCE_PLAN_CODE} = "SP" then {DS_ENCOUNTER_PAYMENTS.PAYMENT_POSTING_DATE}
else dateadd('yyyy',12,currentdate)
|
IP Logged |
|
benner
Newbie
Joined: 18 Mar 2010
Online Status: Offline
Posts: 23
|
Posted: 19 Mar 2010 at 2:45am |
Here is my formula now for the sp pmt:
if {DS_ENCOUNTER_PAYMENTS.INSURANCE_PLAN_CODE} = "SP" then
date(mid(totext({DS_ENCOUNTER_PAYMENTS.PAYMENT_POSTING_DATE},0,''),5,2) + '/' + mid (totext({DS_ENCOUNTER_PAYMENTS.PAYMENT_POSTING_DATE},0,''),7)+'/'+left (totext({DS_ENCOUNTER_PAYMENTS.PAYMENT_POSTING_DATE},0,''),4))else
else dateadd('yyyy',12,currentdate)
I get the error "a number, currency amount, boolean, date, time,date-time or string is expected here"
|
IP Logged |
|
benner
Newbie
Joined: 18 Mar 2010
Online Status: Offline
Posts: 23
|
Posted: 19 Mar 2010 at 2:48am |
Sorry...too early in the morning...I had two "esle"...I'm testing now. Will let you know how it turns out.
|
IP Logged |
|
benner
Newbie
Joined: 18 Mar 2010
Online Status: Offline
Posts: 23
|
Posted: 19 Mar 2010 at 2:58am |
Here is the formula now and this works except when the patient does not have a self pay payment. If there is no self pay payment can we make the date zero? So the date diff will calculate a zero?
if {DS_ENCOUNTER_PAYMENTS.INSURANCE_PLAN_CODE} = "SP" then
date(mid(totext({DS_ENCOUNTER_PAYMENTS.PAYMENT_POSTING_DATE},0,''),5,2) + '/' + mid (totext({DS_ENCOUNTER_PAYMENTS.PAYMENT_POSTING_DATE},0,''),7)+'/'+left (totext({DS_ENCOUNTER_PAYMENTS.PAYMENT_POSTING_DATE},0,''),4))else
dateadd('yyyy',12,currentdate)
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 19 Mar 2010 at 3:49am |
Maybe:
if Minimum ( {@SP Pymnt date}, {DS_ENCOUNTER_PAYMENTS.ENCOUNTER_NUMBER})=
dateadd('yyyy',12,currentdate) then 0
else
datediff('d',(Maximum ( {@Ins Pymnt date}, {DS_ENCOUNTER_PAYMENTS.ENCOUNTER_NUMBER})), (Minimum ( {@SP Pymnt date}, {DS_ENCOUNTER_PAYMENTS.ENCOUNTER_NUMBER})))
|
IP Logged |
|
benner
Newbie
Joined: 18 Mar 2010
Online Status: Offline
Posts: 23
|
Posted: 19 Mar 2010 at 3:55am |
It works! Thank you for all your help on this! This is a great forum.
Thanks again!
|
IP Logged |
|
Kohinoor
Newbie
Joined: 16 Sep 2010
Location: India
Online Status: Offline
Posts: 1
|
Posted: 16 Sep 2010 at 8:44pm |
hi friends
i am using this formula in suppress in crystal report
bcoz i need to compare that date difference is less then 30
if (datediff('d', date({@AsOnDate}), date({command.ImportDate})) > 30)
then true else false
thank you for helping me
i learn it from here only
but still i have some problem so please help me more
thank you again
kohinoor
|
hi i am software developer from gandhinagar,gujarat, india
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 17 Sep 2010 at 3:48am |
1. what is the Asondate formula?
2. what is the problem you are having?
3. drop the if and then portion as it is not needed...
datediff('d', date({@AsOnDate}), date({command.ImportDate})) > 30
|
IP Logged |
|
|