Record Selection Problem and IsNull formula
I have a report that I am trying to create, but am not having any luck getting the Record Selection formula to work properly.
The scenario (CR10 – Access Database) :
My company has several different divisions, and each division sells the same products. I am trying to get a report that will show the outstanding Accounts Receivable balance for each product sold for each division, broken down by date range of how old the receivable balance is.
For example, for Division A, there a number of Product Codes (PC)
PC A
PC B
PC C
PC D
PC E
PC F
PC G
..
..
..
PC X
PC Y
PC Z
The first table (T_MASTER_ATB ) is the table that is a listing of all outstanding unpaid sales, and has the following fields:
FACILITY
DAYS
ATB DATE
BALANCE
PC
The other table (T_MASTER_PC_LIST) is a listing of all of the Divisions and Product Codes (PC). That table has just two fields
FACILITY
PC
The two tables are joined with a LEFT JOIN, with the T_MASTER_PC_LIST on the left, and the T_MASTER_ATB on the right.
I use a record selection formula as shown:
{T_MASTER_ATB.BALANCE} >= $0.00 and
{T_MASTER_ATB.ATB DATE} = 04/01/05 and
{T_MASTER_ATB.DAYS} in 91 to 120 and
{T_MASTER_PC_LIST.FACILTIY} = "DIVISION A" and
({T_MASTER_PC_LIST.PC}= "B" or
{T_MASTER_PC_LIST.PC = "E" or
{T_MASTER_PC_LIST.PC = "F" or
{T_MASTER_PC_LIST.PC = "I" or
{T_MASTER_PC_LIST.PC = "J" or
{T_MASTER_PC_LIST.PC = "K" or
{T_MASTER_PC_LIST.PC = "L" or
{T_MASTER_PC_LIST.PC = "M" or
{T_MASTER_PC_LIST.PC = "O" or
{T_MASTER_PC_LIST.PC = "P" or
{T_MASTER_PC_LIST.PC = "Q" or
{T_MASTER_PC_LIST.PC = "T" or
{T_MASTER_PC_LIST.PC = "U" or
{T_MASTER_PC_LIST.PC = "W" or
{T_MASTER_PC_LIST.PC = "X" or
{T_MASTER_PC_LIST.PC = "Y" or
{T_MASTER_PC_LIST.PC = "Z")
In my report, for PC=X, there are no records that match my selection criteria.
When I use this selection criteria, it works find, and displays the correct records, showing all outstanding balances as expected. But for PC=X, they just show a blank, and all PC’s under it move up on the report display.
For PC’s that do not have any records that match this criteria, I want it to show a 0.00.
I have created an IsNull formula to try to display the NULL PC=X as 0.00, as shown here:
If IsNull (Sum ({T_MASTER_ATB.BALANCE},{T_MASTER_PC_LIST.FC}))
then 0.00
else
(Sum ({T_MASTER_ATB.BALANCE},{T_MASTER_PC_LIST.PC}))
This formula works as long as I do NOT use any record selection formula, and just report on the entire database. But as soon as I use the above Record Selection formula, the IsNull formula does NOT work, and nothing is displayed for PC=X.
In summary….If I use Record Selection, the IsNull formula does not work. If I do NOT use Record Selection, the IsNull formula works, but the entire database is reported, not just the records that I want to see.
Any thought, suggestions are appreciated.
Regards,
David
I have a report that I am trying to create, but am not having any luck getting the Record Selection formula to work properly.
The scenario (CR10 – Access Database) :
My company has several different divisions, and each division sells the same products. I am trying to get a report that will show the outstanding Accounts Receivable balance for each product sold for each division, broken down by date range of how old the receivable balance is.
For example, for Division A, there a number of Product Codes (PC)
PC A
PC B
PC C
PC D
PC E
PC F
PC G
..
..
..
PC X
PC Y
PC Z
The first table (T_MASTER_ATB ) is the table that is a listing of all outstanding unpaid sales, and has the following fields:
FACILITY
DAYS
ATB DATE
BALANCE
PC
The other table (T_MASTER_PC_LIST) is a listing of all of the Divisions and Product Codes (PC). That table has just two fields
FACILITY
PC
The two tables are joined with a LEFT JOIN, with the T_MASTER_PC_LIST on the left, and the T_MASTER_ATB on the right.
I use a record selection formula as shown:
{T_MASTER_ATB.BALANCE} >= $0.00 and
{T_MASTER_ATB.ATB DATE} = 04/01/05 and
{T_MASTER_ATB.DAYS} in 91 to 120 and
{T_MASTER_PC_LIST.FACILTIY} = "DIVISION A" and
({T_MASTER_PC_LIST.PC}= "B" or
{T_MASTER_PC_LIST.PC = "E" or
{T_MASTER_PC_LIST.PC = "F" or
{T_MASTER_PC_LIST.PC = "I" or
{T_MASTER_PC_LIST.PC = "J" or
{T_MASTER_PC_LIST.PC = "K" or
{T_MASTER_PC_LIST.PC = "L" or
{T_MASTER_PC_LIST.PC = "M" or
{T_MASTER_PC_LIST.PC = "O" or
{T_MASTER_PC_LIST.PC = "P" or
{T_MASTER_PC_LIST.PC = "Q" or
{T_MASTER_PC_LIST.PC = "T" or
{T_MASTER_PC_LIST.PC = "U" or
{T_MASTER_PC_LIST.PC = "W" or
{T_MASTER_PC_LIST.PC = "X" or
{T_MASTER_PC_LIST.PC = "Y" or
{T_MASTER_PC_LIST.PC = "Z")
In my report, for PC=X, there are no records that match my selection criteria.
When I use this selection criteria, it works find, and displays the correct records, showing all outstanding balances as expected. But for PC=X, they just show a blank, and all PC’s under it move up on the report display.
For PC’s that do not have any records that match this criteria, I want it to show a 0.00.
I have created an IsNull formula to try to display the NULL PC=X as 0.00, as shown here:
If IsNull (Sum ({T_MASTER_ATB.BALANCE},{T_MASTER_PC_LIST.FC}))
then 0.00
else
(Sum ({T_MASTER_ATB.BALANCE},{T_MASTER_PC_LIST.PC}))
This formula works as long as I do NOT use any record selection formula, and just report on the entire database. But as soon as I use the above Record Selection formula, the IsNull formula does NOT work, and nothing is displayed for PC=X.
In summary….If I use Record Selection, the IsNull formula does not work. If I do NOT use Record Selection, the IsNull formula works, but the entire database is reported, not just the records that I want to see.
Any thought, suggestions are appreciated.
Regards,
David