• Scott Polk
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hi all,
 
First, let me say that i am new to developing with SalesForce and the API.  I am using the Partner WSDL to connect to SF.  I am trying to pull a query that contains a formula field in the condition clause, but i am getting a MALFORMED_QUERY error saying 'unexpected token Next_Invoice_Date__c'.  I have searched and searched for an answer, but i cant seem to find one.
 
My query (VB.NET):
Code:
Dim SFqr As SForce.QueryResult = SFService.query("SELECT Id, Name, ACCT_Last_invoice_date__c, Next_Invoice_Date__c FROM Opportunity " _
                & "WHERE OPS_Lease_Begin_Date__c != null " _
                & "AND Next_Invoice_Date__c <= " & sMaxDate & " " _
                & "AND (Turn_off_billing_date__c = null OR Turn_off_billing_date__c > Next_Invoice_Date__c) " _
                & "AND (ACCT_Last_invoice_date__c != Next_Invoice_Date__c AND ACCT_Last_invoice_date__c != null)")

 The variable sMaxDate is populated with a date in the format yyyy-MM-dd.  The text in red is what the error is referring to.  What i dont understand is why it is excepting the first Next_Invoice_Date__c (in orange), but not the second.

Can someone please advise me on what to do?
 
Thanks in advance
 
~Scott~
Hi all,
 
First, let me say that i am new to developing with SalesForce and the API.  I am using the Partner WSDL to connect to SF.  I am trying to pull a query that contains a formula field in the condition clause, but i am getting a MALFORMED_QUERY error saying 'unexpected token Next_Invoice_Date__c'.  I have searched and searched for an answer, but i cant seem to find one.
 
My query (VB.NET):
Code:
Dim SFqr As SForce.QueryResult = SFService.query("SELECT Id, Name, ACCT_Last_invoice_date__c, Next_Invoice_Date__c FROM Opportunity " _
                & "WHERE OPS_Lease_Begin_Date__c != null " _
                & "AND Next_Invoice_Date__c <= " & sMaxDate & " " _
                & "AND (Turn_off_billing_date__c = null OR Turn_off_billing_date__c > Next_Invoice_Date__c) " _
                & "AND (ACCT_Last_invoice_date__c != Next_Invoice_Date__c AND ACCT_Last_invoice_date__c != null)")

 The variable sMaxDate is populated with a date in the format yyyy-MM-dd.  The text in red is what the error is referring to.  What i dont understand is why it is excepting the first Next_Invoice_Date__c (in orange), but not the second.

Can someone please advise me on what to do?
 
Thanks in advance
 
~Scott~