pdvsa
asked on
Dsum and iif on report
Experts,
I am trying to combine the below in an unbound field on a report.
Maybe its better to do it by VBA?
Not sure which way is easier.
thank you...
In English:
If tblLetterOfCredit.PaidInFu llYN = True then "Paid In Full", if not then Dsum but only if tblPayments.PaymentDate is not null (meaning there is a date entered)
-------------------------- ---------- --
If tblLetterOfCredit.PaidInFu llYN = True then "Paid in Full"
Else:
If is not null [PaymentDate] then Dsum [Amount]. How to add Is Not Nulll to below?
=iif(DLookUp("[PaymentDate ]","tblPay ments","[L CID] = " & [LetterOfCreditID]
dsum("[Amount]","tblPaymen ts","[LCID ] = " & [LetterOfCreditID]
I am trying to combine the below in an unbound field on a report.
Maybe its better to do it by VBA?
Not sure which way is easier.
thank you...
In English:
If tblLetterOfCredit.PaidInFu
--------------------------
If tblLetterOfCredit.PaidInFu
Else:
If is not null [PaymentDate] then Dsum [Amount]. How to add Is Not Nulll to below?
=iif(DLookUp("[PaymentDate
dsum("[Amount]","tblPaymen
ASKER
Hi Daniel,
Thank you for your response. Its pretty close.
Could you kindly assist to add a Dlookup to reference tblPayments.[PaymentDate] since this field is not in my query and if I pulled tblPayments in then the grouping wouldn’t be how I need it. I hope I have explained correctly.
<WhatToPutIfPaymentDateIsNull???
=> think 0 but will have to test (I dont want it to sum the [Amount] for that record).
this is how I have it now (only replaced WhatToPutIfPaymentDateIsNull with 0) :
=IIf([PaidInFullYN]=True,"Paid In Full",IIf(IsNull([PaymentDate])=True,0,DSum("[Amount]","tblPayments","[LCID] = " & [LetterOfCreditID])))
thank you
Thank you for your response. Its pretty close.
Could you kindly assist to add a Dlookup to reference tblPayments.[PaymentDate] since this field is not in my query and if I pulled tblPayments in then the grouping wouldn’t be how I need it. I hope I have explained correctly.
<WhatToPutIfPaymentDateIsNull???
=> think 0 but will have to test (I dont want it to sum the [Amount] for that record).
this is how I have it now (only replaced WhatToPutIfPaymentDateIsNull with 0) :
=IIf([PaidInFullYN]=True,"Paid In Full",IIf(IsNull([PaymentDate])=True,0,DSum("[Amount]","tblPayments","[LCID] = " & [LetterOfCreditID])))
thank you
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Daniel, looks good. It works! I thank you very much. Have good day...stay safe.
Any time and you as well!
Open in new window