I have a field that is date/time with multiple values. I only have the date showing in field.When I do the below… I get an array, but values are not unique. When I do the same thing on a text field, it works just fine. What gives?
newVar = Arrayunique( thisDoc.GetFirstItem( “Untitled” ).Values ) ’ //Returns array but with non-unique values.
newVar = Arrayunique( thisDoc.Untitled ) ’ Returns array with non-unique values.
thks,
jamie
Subject: ArrayUnique with date or date/time values not working
BTW, if this is a bug, where would one report it?
Is there a number to call? A link to a form to fill out somewhere?
Also, I do realize that the above comment that I am responding to does return an array of type variants, but the documentation on ArrayUnique says “Array of any type.” so this should work, right?
Maybe this isn’t a bug, but Lotus should at least explain the date/time issues in documentation/designer help ( 6.5.2).
Thks,
jamie
Subject: Re: ArrayUnique with date or date/time values not working
When you say, “only have the date showing in field”, do you mean in the UI or in the document properties?
If the properties shows date and time, your values are probably not unique.
Subject: RE: Re: ArrayUnique with date or date/time values not working
I mean in the UI. I only have the date showing up in UI. But it still doesn’t matter. If the date is there or not, I still don’t get unique values.
I have one date/time field ( my ‘Untitled’ field )that shows only dates in the document properties for that field such as…
02/12/2005
02/18/2005
02/12/2005
I also have a second field named ‘DateNW’. It is also a date/time field and its values are …
02/21/2005 12:00:00 AM CST
02/21/2005 12:00:00 AM CST
02/22/2005 12:00:00 AM CST
Both fields ( in document field properties ) are of data type: Time/Date List or Range
Both do NOT return me unique values using ArrayUnique.
Any other thoughts?
Thks for response,
jamie
Subject: RE: Re: ArrayUnique with date or date/time values not working
For kicks, try using Cdbl against the LotusScript values and comparing them.
Subject: Tried using cdbl - They are equal…
In both examples, they equal, but arrayunique does not see them as equal
’ Note: ‘Untitled’ field is the date/time field that only stores date value in the document properties… Ex. 02/12/2005 ; 02/18…
newVar = Arrayunique( thisDoc.GetFirstItem( "Untitled" ).Values ) ' // Returns an Array of type variant with non-unique values of type variant
' Vals in new var....... (0) = 02/12/2005 ; (1) = 02/18/2005 ; (2) = 02/12/2005
If Cdbl( newVar(0) ) = Cdbl( newVar(2) ) Then
Msgbox "They equal - what gives?",,"Msg:" '// This is the msg that displays......................
Else
Msgbox "The do not equal - what is up with that?",,"Msg:"
End If
Msgbox "Zero val = '" & Cstr( Cdbl( newVar(0) ) ) & "' ; Two value is '" & Cstr( Cdbl( newVar(2) ) ) & "' .",,"Msg:"
' Note: 'DateNW' field is the date/time field that only stores date value in the document properties..... Ex. 02/21/2005 12:00:00 AM CST ; 02/21/2005 12..
newVar = Arrayunique( thisDoc.GetFirstItem( "DateNW" ).Values ) ' // Returns an Array of type variant with non-unique values of type variant
' Vals in new var....... (0) = 02/21/2005 ; (1) = 02/21/2005 ; (2) = 02/22/2005
If Cdbl( newVar(0) ) = Cdbl( newVar(1) ) Then
Msgbox "They equal - what gives?",,"Msg:" '// This is the msg that displays......................
Else
Msgbox "The do not equal - what is up with that?",,"Msg:"
End If
Msgbox "Zero val = '" & Cstr( Cdbl( newVar(0) ) ) & "' ; One value is '" & Cstr( Cdbl( newVar(1) ) ) & "' .",,"Msg:"