Skip to main content

Help with Formula

I need some assistaance with creating a script. Im trying to take the formula  below and replace it with variables based off an input box. i can get the code to run seperately but when i add the "or" it throws it off. Any help would be appreciated.
task.AddExtraction dbName, "", " CREDIT  >=  ( 1000000 )  .OR.  DEBIT  >=  ( 1000000)"
i have the following but am getting errors
task.AddExtraction dbName, "",   debit & " >= " & amount &  .or.    credit & " >= " & amount

Brian Element Tue, 03/20/2018 - 19:43

Hi and welcome to the site.  The .OR. and field names are part of the equation so you have to leave them within the quotes.  The only thing that should be outside of the quotes is the variables.  So assuming that the debit and credit are the fieldnames and not variable your equation should probably look like this:

task.AddExtraction dbName, "", " CREDIT  >=  " & amount & "  .OR.  DEBIT  >= " & amount

Let me know if you have any problems, good luck with your project.

Brian

 

profit814 Wed, 03/21/2018 - 07:41

Thanks for the comment and quick response Brian, if i want both credit and debit to be variables as well, how would i modify the line.

Brian Element Wed, 03/21/2018 - 09:53

In reply to by profit814

If they are both variables then the line would look something like this:

task.AddExtraction dbName, "", creditVar & " >=  " & amount & "  .OR.  " & debitVar & "  >= " & amount