Hi all,
I have a report that is currently driving me a bit potty!
I have a formula field that SHOULD give an invoice amount if certain criteria are met, or not.
Here's the formula:
if isnull({query_status.id}) then {invoices.amount_open} else
if {@DaysOutstanding} >= 90 and
{@InternalDispute} = 'No' and
{query_status.id} <> 2
then {invoices.amount_open} else 0
The problem being that its ignoring the @DaysOutstanding rule. Any ideas?
Here are my links:
SELECT "invoices"."invoice_number", "debtor_freefields"."ff4", "invoices"."amount_open", "debtors"."debtor_number", "debtor_freefields"."ff3", "queries"."query_date", "query_status"."id", "invoices"."date_due", "standard_queries"."code"
FROM ((("OnGuard"."dbo"."debtor_freefields" "debtor_freefields" INNER JOIN ("OnGuard"."dbo"."invoices" "invoices" INNER JOIN "OnGuard"."dbo"."debtors" "debtors" ON "invoices"."debtor_id"="debtors"."id") ON "debtor_freefields"."debtor_id"="debtors"."id") LEFT OUTER JOIN "OnGuard"."dbo"."queries" "queries" ON "debtors"."id"="queries"."debtor_id") LEFT OUTER JOIN "OnGuard"."dbo"."standard_queries" "standard_queries" ON "queries"."standard_query_id"="standard_queries"."id") LEFT OUTER JOIN "OnGuard"."dbo"."query_status" "query_status" ON "queries"."query_status_id"="query_status"."id"
I'm sorry if this is an easy one to solve, I seem to be having one of those days!
Thanks in advance
Di
I have a report that is currently driving me a bit potty!
I have a formula field that SHOULD give an invoice amount if certain criteria are met, or not.
Here's the formula:
if isnull({query_status.id}) then {invoices.amount_open} else
if {@DaysOutstanding} >= 90 and
{@InternalDispute} = 'No' and
{query_status.id} <> 2
then {invoices.amount_open} else 0
The problem being that its ignoring the @DaysOutstanding rule. Any ideas?
Here are my links:
SELECT "invoices"."invoice_number", "debtor_freefields"."ff4", "invoices"."amount_open", "debtors"."debtor_number", "debtor_freefields"."ff3", "queries"."query_date", "query_status"."id", "invoices"."date_due", "standard_queries"."code"
FROM ((("OnGuard"."dbo"."debtor_freefields" "debtor_freefields" INNER JOIN ("OnGuard"."dbo"."invoices" "invoices" INNER JOIN "OnGuard"."dbo"."debtors" "debtors" ON "invoices"."debtor_id"="debtors"."id") ON "debtor_freefields"."debtor_id"="debtors"."id") LEFT OUTER JOIN "OnGuard"."dbo"."queries" "queries" ON "debtors"."id"="queries"."debtor_id") LEFT OUTER JOIN "OnGuard"."dbo"."standard_queries" "standard_queries" ON "queries"."standard_query_id"="standard_queries"."id") LEFT OUTER JOIN "OnGuard"."dbo"."query_status" "query_status" ON "queries"."query_status_id"="query_status"."id"
I'm sorry if this is an easy one to solve, I seem to be having one of those days!
Thanks in advance
Di