Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim dc As NotesDocumentCollection
Dim v As NotesView
Dim v2 As NotesView
Dim vc As NotesViewEntryCollection
Dim z(5) As String
Set doc = s.DocumentContext
z(0)=doc.GetItemValue("PPage")(0)
z(1)=doc.GetItemValue("PPxueli")(0)
z(2)=doc.GetItemValue("PPzz")(0)
z(3)=doc.GetItemValue("PPsex")(0)
z(4)=doc.GetItemValue("PPzyjs")(0)
z(5)=doc.GetItemValue("PPgrjs")(0)
'If z = "不限" Then z="."
Msgbox doc.GetItemValue("PPage")(0)
Msgbox doc.GetItemValue("PPxueli")(0)
Msgbox doc.GetItemValue("PPzz")(0)
Msgbox doc.GetItemValue("PPsex")(0)
Msgbox doc.GetItemValue("PPzyjs")(0)
Msgbox doc.GetItemValue("PPgrjs")(0)
Set db = s.CurrentDatabase
Set v = db.GetView("Vname")
Set v2 = db.GetView("SearchTemplate")
Set vc= v2.AllEntries
Call vc.RemoveAllFromFolder("SearchTemplate")
'@date(2003;8;13)
'searchfomular$="(Field birthday >= 2003-08-18 and Field birthday <= 2003-09-18)"
'v2.FTSearch("",10)
'Set dc=db.FTSearch("select form="$$Viewtemplate for SearchTemplate" & (age>20 & age<30)")
searchformula$={Form="$$Viewtemplate for SearchTemplate" & birthday >=2003-08-08}
Set dc=db.FTSearch(searchformula$,Nothing,0)
'Set dc = v.GetAllDocumentsByKey(z,False)
'Call dc.PutAllInFolder("SearchTemplate",Nothing,0)
Msgbox dc.Count
End Sub
searchFormula$ = {Form = "表单1"&condition1=" "text1.text"&condition2= " "text2.text"&condition3>=}+@TextToTime(age1)+{&condition3<=}+@TextToTime(age2)
Set collection = db.FTSearch(searchFormula$,nothing,0)
initialize:43:type mismatch
通配付问题
问题解决了,用Like operator
? Any one character
# Any one digit from 0 through 9
* Any number of characters (zero or more)
如要查找域a="a" 域b="b",可以在lotus script中用以下语句:
queryStr={select a="a" & b="b"}
set dc=db.search(queryStr,nothing,0)
这样dc就是查询得到的文档集。
///
strKey="DBJLX='" & curdoc.DBJLX(0) & "' & swrq>=@texttotime('" & curdoc.from(0) & "') & swrq<=@texttotime('" & curdoc.To(0) & "')
Set vc=view.AllEntries
Call vc.FTSearch(strKey,0)
///
searchFormula$ = "Form = ""fmNewFile"" & fdTitle =""MyFile.txt"""
or
searchFormula$ = "Form = ""fmNewFile"" | fdTitle =""MyFile.txt"""
Set collection = db.Search(searchFormula$,nothing,0)
///
FTSearch(select form="formname" & (fieldname>20 & fieldname<30))
select form="something" & (fieldname>20 & fieldname<30 )
其中fieldname必须是数值域