2 Replies Latest reply on Jan 16, 2014 8:36 AM by AlexTorry

    Records from previous month

    AlexTorry

      Title

      Records from previous month

      Post

           Hi everyone,

           I tought I had this solved but now I realize I am missing something, I need a script to find all records from the previous month, so far I had this:

           Month(Get(CurrentDate)) -1

           But now in January is not working....what am I missing here?

           Thanks 

            

        • 1. Re: Records from previous month
          philmodjunk

               Does your script work like this?

               Enter FInd Mode []
               Set Field [ YourTable::DateField ; Month ( Get ( CurrentDate ) ) - 1 & "/" & Year ( Get ( CurrentDate ) ) ]
               Perform FInd []

               If so, use:

               Let ( [ m =  Month ( Get ( CurrentDate ) ) - 1  ;
                         m = If ( m = 0 ; 12 ; m ) ;
                         y = Year ( Get ( CurrentDate ) ) - If ( m = 12 ; 1 )
                       ];
                        m & "/" & y
                      )

                

          • 2. Re: Records from previous month
            AlexTorry

                 Flawless! Thank You