Romio_1968
Member
- Local time
- Today, 23:52
- Joined
- Jan 11, 2023
- Messages
- 126
I have a report based on the following query
<CODE>
SELECT GeneralLedger.AddDate, GeneralLedger.Inventory_No, GeneralLedger.Title_ID, GeneralLedger.Call_No, GeneralLedger.Media, GeneralLedger.Title, GeneralLedger.Publisher, GeneralLedger.PublishPlace, GeneralLedger.PrintYear, GeneralLedger.ScrapDate, GeneralLedger.AuthorNames
FROM GeneralLedger
WHERE (((GeneralLedger.AddDate) >= [Forms]![GeneralLedger_Frm]![StartDate] AND (GeneralLedger.AddDate) <= [Forms]![GeneralLedger_Frm]![EndDate]) AND ((GeneralLedger.Inventory_No) BETWEEN ([Forms]![GeneralLedger_Frm]![Start_No]) AND ([Forms]![GeneralLedger_Frm]![End_No]))) OR (((GeneralLedger.Inventory_No) BETWEEN ([Forms]![GeneralLedger_Frm]![Start_No]) AND ([Forms]![GeneralLedger_Frm]![End_No])) AND ((GeneralLedger.ScrapDate) >= [Forms]![GeneralLedger_Frm]![StartDate] AND (GeneralLedger.ScrapDate) <= [Forms]![GeneralLedger_Frm]![EndDate]))
ORDER BY GeneralLedger.Inventory_No;
</CODE>
In the footer section I have an unboundcontrol to get the total number of Inventory_No displayed by the report, using
=Count([Inventory_No])
as control source.
In this case is the total number of records, and it works.
A second control should display the total number of distinct (unique) values in the Title_ID. I tried
=DCount("[Title_ID]","GeneralLedger")
but the result is not correct. It is also indicating the total no of records, instead of unique titles (about 6000)
Please help.
Thank You
<CODE>
SELECT GeneralLedger.AddDate, GeneralLedger.Inventory_No, GeneralLedger.Title_ID, GeneralLedger.Call_No, GeneralLedger.Media, GeneralLedger.Title, GeneralLedger.Publisher, GeneralLedger.PublishPlace, GeneralLedger.PrintYear, GeneralLedger.ScrapDate, GeneralLedger.AuthorNames
FROM GeneralLedger
WHERE (((GeneralLedger.AddDate) >= [Forms]![GeneralLedger_Frm]![StartDate] AND (GeneralLedger.AddDate) <= [Forms]![GeneralLedger_Frm]![EndDate]) AND ((GeneralLedger.Inventory_No) BETWEEN ([Forms]![GeneralLedger_Frm]![Start_No]) AND ([Forms]![GeneralLedger_Frm]![End_No]))) OR (((GeneralLedger.Inventory_No) BETWEEN ([Forms]![GeneralLedger_Frm]![Start_No]) AND ([Forms]![GeneralLedger_Frm]![End_No])) AND ((GeneralLedger.ScrapDate) >= [Forms]![GeneralLedger_Frm]![StartDate] AND (GeneralLedger.ScrapDate) <= [Forms]![GeneralLedger_Frm]![EndDate]))
ORDER BY GeneralLedger.Inventory_No;
</CODE>
In the footer section I have an unboundcontrol to get the total number of Inventory_No displayed by the report, using
=Count([Inventory_No])
as control source.
In this case is the total number of records, and it works.
A second control should display the total number of distinct (unique) values in the Title_ID. I tried
=DCount("[Title_ID]","GeneralLedger")
but the result is not correct. It is also indicating the total no of records, instead of unique titles (about 6000)
Please help.
Thank You