Search code examples
oracle-databasenetsuite

How to compare two columns in netsuite in a saved Search


I have two columns Vendor Account (in the bill) and the default payables account in the vendor record. We have some wrong postings and I want to create a saved search to control this. I've isolated the account number and default account number, however i can't seem to create a formula column that compares them (with a case formula i.e)

Is it because one of the account columns might be in text? What are the problems that can be happening here?

Columns to be compared


Solution

  • Assuming that "Vendor Account" and "Vendor Payables Account" are both number/integer fields the following case statement should work. Be sure to replace the field ids to match your account.

    CASE WHEN {VendorAccount}={VendorPayablesAccount} THEN 'T' ELSE 'F' END
    

    If the fields are not number fields use the following:

    CASE WHEN TO_NUMBER({VendorAccount}) = TO_NUMBER({VendorPayablesAccount}) THEN 'T' ELSE 'F' END