function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CJDEVCONPROCJDEVCONPRO 

VB.NET Query question.

How can I do the following?
 

Dim qr As sforce.QueryResult = binding.query("Select Id, Name, AccountNumber from Account Where not AccountNumber = null") '<--AND Where AccountNumber = 1")

Is this possible?

 

SuperfellSuperfell
Well, 1 is by definition not null, so would't it just be

Dim qr As sforce.QueryResult = binding.query("Select Id, Name, AccountNumber from Account Where AccountNumber = 1")
SkowronekSkowronek
According to API docs use:
 
Dim qr As sforce.QueryResult = binding.query("Select Id, Name, AccountNumber from Account Where AccountNumber != ''")
 

Operator

Name

Description

=

Equals

Expression is True if the value in the specified fieldName equals the specified value in the expression. String comparisons using the equals operator are case-insensitive.

!=

Not equals

Expression is True if the value in the specified fieldName does not equal the specified value.

<

Less than

Expression is True if the value in the specified fieldName is less than the specified value.

<=

Less or equal

Expression is True if the value in the specified fieldName is less than, or equals, the specified value.

>

Greater than

Expression is True if the value in the specified fieldName is greater than the specified value.

>=

Greater or equal

Expression is True if the value in the specified fieldName is greater than or equal to the specified value.

SkowronekSkowronek
Sorry, Simon has it correct, I didn't notice you wanted to filter only by 1. Since you're only looking for 1, filter for it only. Use mine if you want all that are not null or ''.
CJDEVCONPROCJDEVCONPRO

DUH!!! I guess I am a little tired.

Thanks!!

CJDEVCONPROCJDEVCONPRO

It gave me an error stating I needed to have the 1 in quotes.

 

How when it is part of the query?

SuperfellSuperfell
Yes, AccountNumber is a string, so it should be where accountNumber = '1'