Skip to content

Commit

Permalink
Use 'and' instead of 'or' on comma delimited 'not equals' queries
Browse files Browse the repository at this point in the history
  • Loading branch information
tresni committed Apr 3, 2012
1 parent bfe2573 commit 38aa05f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion s_force.bas
Expand Up @@ -420,7 +420,13 @@ Sub sfQuery(Optional RowsReturned As Integer) ' 6.12
str = SFDC_escape_q(str) ' escape some chars str = SFDC_escape_q(str) ' escape some chars
vu = salesforce.ref_id(str, field_obj.ReferenceTo) ' map strs to refid's 5.46 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 "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 "begins with" Or opr Like "starts with") Then vu = vu & "%" ' wildcar at front
If (opr Like "ends with") Then vu = "%" & vu ' wlidcard at end If (opr Like "ends with") Then vu = "%" & vu ' wlidcard at end
Expand Down

0 comments on commit 38aa05f

Please sign in to comment.