4 Replies Latest reply on Mar 15, 2013 11:22 AM by Arn

    Exporting based on an entry date

    Arn

      Title

      Exporting based on an entry date

      Post

           Currently I am exporting the entire database when the user clicks on a button to export.

           What I would like to do is only export what has been added as of the current date.

           I have a field that automatically populates the date.

           Seems like there has to be some way I can modify my script to only export the records that match to the current date.

           Any help would be great.

            

           Thanks.

           Aaron.

        • 1. Re: Exporting based on an entry date
          philmodjunk

               I am assumming that you are using Export Records or Save As Excel when you do this. If you are saving a copy of your database file, a different approach will be needed:

               Have your script perform a find for the records with the date or range of dates that you want to export, then export yourdata.

               Here is a thead that shows a number of different examples of scripted finds using dates: Scripted Find Examples

          • 2. Re: Exporting based on an entry date
            Arn

                 Slightly confused by the example.

                 My Entry Date field is already populated with a date.

                 My script currently is just:

                 Export Records[No dialog;"mact.csv";Windows (ANSI)]

                 I was looking at adding an IF statement matching the my Members::Entry field = Date(month;day;year)

                 Then if it was true then export the record, but I am guesing something like that will not work for this?

            • 3. Re: Exporting based on an entry date
              philmodjunk

                   Like I said in my last post, perform a find for the records that you want to export then export them.

                   an If statement like that would have to loop through all the records in your table--a very slow and inefficient way to do this.

                   Enter FInd Mode[]
                   Set Field [YourTable::YourdateField ; //specify the date that you want here ]
                   Set error capture [on]
                   Perform Find[]
                   Export Records [....

                   in place of //specify the date that you want here, there are any number of different ways you can specify a date. That's why I referred you to the other thread so that you can look over the examples and pick one that works best for you.

              • 4. Re: Exporting based on an entry date
                Arn

                     Ok, got it to work. That last bit made sense when put with your other post.

                     Thanks so much for your help.