Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Do not load record with null field

How can i adjust my load script to ensure the recorded without an AccountId are NOT loaded

Both these expressions kick up errors. What exactly am I doing wrong?

WHERE NOT IsNull(AccountId);

and

WHERE len(trim(AccountId))>0;

18 Replies
Not applicable
Author

Yes, youre right Jonathan. It is


the complete script is


SQL SELECT *

FROM Contact

WHERE RecordTypeId NOT IN ('012w000000063XQ','012w000000063qu') AND AccountId IS NOT NULL;



Apologies Charles and Anbu for not being a little clearer. I should have posted the entire script


However I now get this error error

error.png

anbu1984
Master III
Master III

Which database are you connecting to?

Not applicable
Author

SalesforceDLL.dll

anbu1984
Master III
Master III

Try

WHERE AccountId = NULL;

antoniotiman
Master III
Master III

Hi Alex,

have You tried with Preceding Load Sintax ?

Like :

Load *

Where Not IsNull(Field);

SQL Select *

From Table;

Not applicable
Author

I assume you meant

WHERE NOT AccountId = NULL;



That gives the error

ERROR at Row:2:Column:68 unexpected token: 'NOT'



anbu1984
Master III
Master III

For Not Null, try this

WHERE AccountId != NULL;

Not applicable
Author

This worked!!!

thanks

anbu1984
Master III
Master III

You can use Not and IsNull()

Where Not(IsNull(AccountId ))

If you are looking for where AccountId is not blank, then use this

Where AccountId != ''

Or

Where Not(IsBlank(AccountId ))