Last Record of Month
Using Delphi XE, NexusDB 3.x database and ReportBuilder 14.x.
I need to select records for the last day of each month.
I have a table with records having a Date Field called RepDate. These
records are generated each day as part of an end of day processing. I
need to make a report that selects only the last record for each month.
The RepDate may be the last day of the month, or not the last day of
the month because sometimes the stores are closed on the last day of
the month (for example, if that day is Sunday or a holiday). How do I
do this? What is the best approach?
--
I need to select records for the last day of each month.
I have a table with records having a Date Field called RepDate. These
records are generated each day as part of an end of day processing. I
need to make a report that selects only the last record for each month.
The RepDate may be the last day of the month, or not the last day of
the month because sometimes the stores are closed on the last day of
the month (for example, if that day is Sunday or a holiday). How do I
do this? What is the best approach?
--
This discussion has been closed.
Comments
This will likely need to be handled on your DB. SQL Server, for
instance, has the EOMONTH call to retrieve the last day of the month.
Other DB’s likely have similar features.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
--
That is not really what I need, the last day of a month, because the
record for the last day of the month may not exist. What I am thinking
is sorting by date and using a group and filter somehow, but not
exactly sure how. Is there some way to mark each record not to print
as it processes through if the next record is part of the same month?
How exactly could this be done?