In Lotus script, In notes DB dbsearch query string logical operator is "|" not allowing. How to over come this?

(Form = “UTR” & PayGrade = ‘’ & Attendance = 0 | Attendance = ‘’ )

for notesdatabase dbsearch i am using this query but it escaping “|” operator and showing error on query i.e.

Formula error, (Form = “UTR” & PayGrade = ‘’ & Attendance = 0 Attendance = ‘’ )

I tried,

str1= ’ Form = “UTR” & PayGrade = “” & Attendance = 0’

str2 = ’ | Attendance = “” ’

query_str = str1+str2

and use this query_str for dbsearch, but still this not. it escaping “|” operator. and showing error on query i.e.

Formula error, (Form = “UTR” & PayGrade = ‘’ & Attendance = 0 Attendance = ‘’ )

I had use ASCII value of “|” but still same error, it escapling “|” oprator

I had use “OR” but still same error, it escapling “|” oprator

Subject: In Lotus script, In notes DB dbsearch query string logical operator is “|” not allowing. How to over come this?

Do you use {} as string delimiters, as you should in this case?

Subject: RE: In Lotus script, In notes DB dbsearch query string logical operator is “|” not allowing. How to over come this?

no, its not working still.

Subject: RE: In Lotus script, In notes DB dbsearch query string logical operator is “|” not allowing. How to over come this?

Could you please post a copy-pasted excerpt of your actual code?

Single quotes are not valid string delimiters, neither in LotusScript, nor in @Formulas, so stuff like this

001 str1= ’ Form = “UTR” & PayGrade = “” & Attendance = 0’

002 str2 = ’ | Attendance = “” ’

003 query_str = str1+str2

would always have thrown a compile time error in line 001 and stuff like this

PayGrade = ‘’ & Attendance = 0 | Attendance = ‘’

will always cause a runtime error.

If your search formula contains double quotes (") and the pipe sign (|), two of the three string delimiters accepted by LotusScript are already ruled out. You can still use curly brackets, so there’s no need to escape the pipe sign.

Also note the order of precedence of operators in @Formulas. Looking at you code, you probably want to use this as the search query:

Dim query As String

query = {Form = “UTR” & PayGrade = “” & (Attendance = 0 | Attendance = “”)}