2 Replies Latest reply on Feb 1, 2010 2:19 PM by nolak37

    Check backpay dates



      Check backpay dates




      I need a script that will check if a payment is past due and im not very familiar working with dates.


      I have a field in my table named payment status, this is automatically set to "Pending" when the record is created.


      The script should check all records in the DB, on the ones pending check the date created and compare to CurrentDate.

      if it is 30 days past i will set it to send an email using SMTP to the Billing Department. (i already know how to do this)


       if anyone can help me with the part of thee script that check the dates I would greatly appreciate it, also if you could break it down so i can see what each part does or means im sure it would help me learn for future refrence.


      Thanks in advance



        • 1. Re: Check backpay dates

          Howdy yoshi,


          Dates add and subtract by DAYS.


          If you want to find things that are "Pending" and were created more than 30 days ago:


          Enter Find Mode

          SetField [ Status ; "Pending" ]

          Setfield [ CreationDate ; "<" & ( Get(CurrentDate) - 30 ) ]

          Perform Find []


          Earlier dates are "less than" later dates, and "Today - 30" is 30 days ago.


          Is this what you were after?

          • 2. Re: Check backpay dates

            Hey ninja


            Thanks for your response, I just tried it out and yes, this takes care of it.


            Gotta tell you its a lot easier than i thought. Maybe you just need a fresh set of eyes, or a new brain lol


            Either way thanks