在代理中日期如何比较?急!!!
我写了一个代理,统计一段日期之间某个部门用的经费总数,代码如下:
Dim s As New notessession
Dim doc,doc1 As notesdocument
Dim view As notesview
Dim db As notesdatabase
sum=0
Set db=s.currentdatabase
Set view=db.getview("FinanceByDate")
Set doc=s.documentcontext
Set doc1=view.getfirstdocument()
While doc1 Is Nothing
If Trim(doc.Department(0))=doc1.Department(0) Then
If (doc1.EnterTime(0)>=doc.FromDate(0) And doc1.EnterTime(0) <=doc.EndDate(0)) Then
sum=sum+doc1.MoneySum(0)
End If
End If
Set doc1=view.getnextdocument(doc1)
Wend
明明在中间有记录的,可是统计出来sum却为0。不知道是哪里错了,是不是日期的比较错了,请高手指教!