Permalink
Browse files

Use 'and' instead of 'or' on comma delimited 'not equals' queries

  • Loading branch information...
1 parent bfe2573 commit 38aa05f5e0e4f41030cf7da13d849b0e80717454 @tresni committed Apr 3, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 s_force.bas
View
@@ -420,7 +420,13 @@ Sub sfQuery(Optional RowsReturned As Integer) ' 6.12
str = SFDC_escape_q(str) ' escape some chars
vu = salesforce.ref_id(str, field_obj.ReferenceTo) ' map strs to refid's 5.46
- If Len(clause) > 0 Then clause = clause & " or " ' prepend an or
+ If Len(clause) > 0 Then
+ If (opr Like "!=") Then
+ clause = clause & " and "
+ Else
+ clause = clause & " or " ' prepend an or
+ End If
+ End If
If (opr Like "like") Then vu = "%" & vu & "%" ' wrap like string with wildcard
If (opr Like "begins with" Or opr Like "starts with") Then vu = vu & "%" ' wildcar at front
If (opr Like "ends with") Then vu = "%" & vu ' wlidcard at end

0 comments on commit 38aa05f

Please sign in to comment.