4 Replies Latest reply on Jan 24, 2013 3:04 PM by braman1

    Report filter by current date


      Report filter by current date


           I have a simple database that is recording stock trades.  A user will input the symbol, price, shares, and buy or sell in a form layout.  I have a timestamp field that records each record.

           What I am trying to accomplish is to have a button on the form layout that opens a report that will filter the trades by current date.  I would like to have maybe another button to open another report that will filter by week or even by month.

           What is the best way to accomplish this?  I'm having a mental block.

           Thank you. 

        • 1. Re: Report filter by current date

               Much depends on the structure of your data. But a script can use Get ( CurrentDate ) to find records with today's date.

               See this thread for a number of examples of scripted finds: Scripted Find Examples

               Date range finds can find records for a specified week, month, quarter or year.

          • 2. Re: Report filter by current date


                 The examples are a big help and it works.

                 One problem now is by running the script to filter by current date, the sub-summary by account # is ignored.  Any way to keep the sub-summary by account number and filter just the current date records?


            • 3. Re: Report filter by current date

                   Sub summary layout parts are only visible if the found set of records are sorted in a sort order that includes the "when sorted by" field specified for the layout part.

                   Finds produce an unsorted found set so your sub summary layout parts will not be visible until you sort your records. But the same script that finds the records can also sort the records so as to keep your sub summary layout part visible.

              Advanced reporting trick:

                   Since sub summary layout parts are only visible when their break (Sorted by) field is included in the sort order, you can use one layout to produce a variety of differnt report formats just by using different sort orders to group your records differently and control which sub summary parts are visible for a given report.

              • 4. Re: Report filter by current date

                     Works perfectly!!

                     Thanks again Phil!