2 Replies Latest reply on Feb 19, 2009 7:04 AM by abitech

    Creating a report for 6 month old records

    abitech

      Title

      Creating a report for 6 month old records

      Post

      Once again I need your help.

      I have to create a report with customers that haven't been contacted in 6 months or more. How do I create a script that finds records with a "last contact date" that is at least 6 months older than the current date?

       

      Thank you.

        • 1. Re: Creating a report for 6 month old records
          Orlando
            

          Hi abitech

           

          You want to use the Date function in your find to calculate a date six month previous and search on equals to or less that that date, so it might look like this

           

          #
          Set Error Capture [ On ] 
          Enter Find Mode [] // Deselect Pause
          Set Field [ TABLE::ContactDate ;
           
          Let ( 
          Current = Get ( CurrentDate ) ;

          " ≤ " & Date ( Month ( Current ) - 6 ; Day  ( Current )  ; Year  ( Current ) )

          )
           

           ] 
          Perform Find []
          #
          If [ Get ( FoundCount ) = 0 ]
          Show Custon Dialog [ "No record found" ] 
          End If

           

          And this will also display a message if no records are found.

           

          I hope this helps         



          • 2. Re: Creating a report for 6 month old records
            abitech
               Brilliant, it does what I needed it to do. Thanks a lot for your quick help!