Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: robertpp am 14.04.03 - 11:03:23

Titel: @Today - Datumsfeld
Beitrag von: robertpp am 14.04.03 - 11:03:23
Ich habe in FS ein Code der lautet:
SetField("difdate";(ArchEndTime-@Today)/86400);
Das liefert mir eine ganze Zahl zurück wie viele Tag zwischen den Tagen liegen. das auch richtig ist.
Das ganze wollte ich mir jetzt im LS-Sprache auch basteln nur bekomm ich da immer ein Zahl mit dezimalstellen. Ich habs mal so probiert :

doc.difdate=(doc.ArchEndTime(0)-Today())/86400
oder
doc.difdate=(doc.ArchEndTime(0)-Date)/86400

bitte um hilfe robertpp


Titel: Re:@Today - Datumsfeld
Beitrag von: Rob Green am 14.04.03 - 11:10:22
Martin Scott / http://www.martinscott.com/DesignLibrary.nsf/scategory/B86B846410A8922985256C08001DF55E?opendocument :
 'doc is a notesdocument to find difference in days between say today
'and another date say doc.created i.e the date of creation of the
'document
daydiff=abs(int(Cbdl(Today)-Cbdl(doc.created)))
'would do "Cbdl" is used to get the double numeric format of the dates
'the decimal part which is time is removed by using "Int" and "Abs"
'returns absolute value

oder Ata´s Datehandling DB:
http://www.anton-tauscher.de/Download/DateHandling.zip
Titel: Re:@Today - Datumsfeld
Beitrag von: robertpp am 14.04.03 - 11:59:59
wo ist das ganze in ata seiner DB?
robertpp
Titel: Re:@Today - Datumsfeld
Beitrag von: Till_21 am 14.04.03 - 12:14:49
wenn mich nicht alles taeuscht, in einer Script-Bibliothek...

gruss
Titel: Re:@Today - Datumsfeld
Beitrag von: robertpp am 14.04.03 - 13:41:22
Ich komm leider zu keiner lösung ich hab auch schon einiges ausprobiert ich weiß aber nicht ob das überhaupt so funken kann!
'         doc.difdate=Abs(Int(Cdbl(doc.EndTime)-Cdbl(Date)))/86400
'         doc.difdate=(Day(doc.EndTime)-Date)/86400                  
'         doc.difdate=(Datevalue(doc.EndTime)-Date)/86400                  
'         doc.difdate=Abs((doc.EndTime(0)-Date)/86400)

das EndTime-Feld ist ein Datumsfeld!!
kann mir wer weiter helfen!
robertpp
Titel: Re:@Today - Datumsfeld
Beitrag von: Rob Green am 14.04.03 - 13:47:50
hab das in einen Button reingehauen und 2 Felder Date1/Date2...

Dim NWS As New NotesUIWorkspace
   Dim UIDoc As NotesUIDocument
   Set UIDoc = NWS.currentdocument
   Dim Doc As NotesDocument
   Set Doc = UIDoc.document
   
   daydiff=Abs(Int(Cdbl(doc.Date1(0))-Cdbl(doc.Date2(0))))
   Msgbox Cstr(daydiff)

Klappt wunderbar...war übrigens oben ein Schreibfehler aus Martin Scotts Codelib...statt "Cbdl" heißt es "Cdbl"
Titel: Re:@Today - Datumsfeld
Beitrag von: robertpp am 14.04.03 - 14:31:58
Bei mir klappt es jetzt auch!!!

danke
robertpp
Titel: Re:@Today - Datumsfeld
Beitrag von: ata am 14.04.03 - 16:49:28
... falls du noch Interesse an der Lib hast...

http://www.anton-tauscher.de/downloads/DateHandling.nsf (http://www.anton-tauscher.de/downloads/DateHandling.nsf)
http://www.anton-tauscher.de/downloads/DateHandling.zip (http://www.anton-tauscher.de/downloads/DateHandling.zip)

ata
Titel: Re:@Today - Datumsfeld
Beitrag von: robertpp am 14.04.03 - 17:01:18
danke @ata
Ich hab sie mir eh schon vor längeren heruntergesaugt aber ich hab nicht gewusst wo ich in der db das finden kann!!

robertpp
Titel: Re:@Today - Datumsfeld
Beitrag von: ata am 14.04.03 - 19:00:27
... die Lib liegt  bei Resourcen unter Libraries
... eingebunden wird sie, indem du die Lib bei dir einfügst, und dort wo du sie benötigst mit Use "Datehandling" einbindest. Ab dann gehst du mit der Lib so um, wie ich es in der Beispielmaske demonstriere...

ata