Domino 9 und frühere Versionen > Entwicklung

Alle Dokumente mit DeliveredDate "gestern oder früher" (Script)

<< < (2/3) > >>

Driri:
Versuchs mal so :

If wert(0) <> Today() Then

DerAndre:
Ist die Formatierung identisch?

Aus der Hilfe:

' LotusScript assigns Today’s date to the String
' variable whenNow.
Dim whenNow As String
whenNow$ = Today()
Print whenNow$
' Output:
' 6/7/95

HRaq:
Hallo Ingo und Andre,

es ist jetzt so, wie Ingo beschrieben hat - juckt ihn aber nicht....Er nimmt trotzdem die Docs von heute nimmt.......grummel

Glombi:
Ich würde mit der NotesDateTime Klasse arbeiten.

Also:
dim ndt_Today as NotesDateTime
dim ndt as NotesDateTime
Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim arcdb As New NotesDatabase("" , "archiv.nsf")
   Dim dc As NotesDocumentCollection
   Dim doc As NotesDocument
   Dim wert As Variant
   Dim nextdoc As notesdocument
   
   Set db = session.CurrentDatabase
   Set dc = db.AllDocuments
   Set doc = dc.GetFirstDocument

set ndt_Today  = New NotesDateTime( Today )
   
   Do Until doc Is Nothing
      Set nextdoc = dc.getnextdocument(doc)
     
      set ndt = New NotesDateTime( doc.GetItemValue("DeliveredDate")(0) )
      If ndt.DateOnly <> ndt_Today.DateOnly  Then
         Call doc.CopyToDatabase(arcdb)               
             Call Doc.Remove( True )     
      End If
      Set doc = nextdoc
   Loop



Andreas

koehlerbv:
Was für ein Datentyp hat denn DeliveredDate?

Aber Blödsinn: Wenn in DeliveredDate Date/Time steht, dann vermutlich auch mit Uhrzeitkomponente. Die hat natürlich Today nicht.

Daher muss es heissen (wenn alle Dokumente von vor heute entfernt werden sollen):
wert (0) < Today.

Wenn tatsächlich ein ungleich erforderlich ist:
Clng (wert (0)) <> Today.

Andreas: Die DateTime class braucht man hier wirklich nicht. Kann man natürlich, aber das ist mit Kanonen auf Spatzen geschossen.

Bernhard

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln