DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

datafinder read properties type "DataTypeDate" from script

Solved!
Go to solution

Hello All,

 

What do I need to read "Modify date" property value from my Datafinder resultlist?

  

result of:

Dim oMyDataFinder, oMyQuery, MyDate, MyMin, oMyResults
  Set oMyDataFinder = Navigator.ConnectDataFinder("My DataFinder")
  If oMyDataFinder.Name = "My DataFinder" Then
                   Dim AdvancedQuery
             Set  AdvancedQuery =Navigator.CreateQuery(eAdvancedQuery)
             AdvancedQuery.ReturnType=eSearchFile
             Call AdvancedQuery.Conditions.Add(eSearchFile,"aaaa","=", "*")
             oMyDataFinder.Search(AdvancedQuery)
             Set oMyResults = oMyDataFinder.Results

msgbox(oMyDataFinder.Results(1).Properties("modifyTime").value)

 

is err. number 438. "proprietà o metodo non supportati dall.oggetto"

oMyResults.count return 1

 My property value is "11/15/2010 11:08:30".

 

Thanks,

Yustas

0 Kudos
Message 1 of 4
(3,678 Views)
Solution
Accepted by topic author Yustas

Hello Yustas,

 

for date/time properties an object called "UsiTimeDisp" is returned.

To print the date using msgbox please try

 

msgbox(oMyDataFinder.Results(1).Properties("modifyTime").value,variantdate)

 

Hope that helps,

 

Eva

Message 2 of 4
(3,675 Views)

Hello Eva,

 

it works

 

msgbox(oMyDataFinder.Results(1).Properties("modifyTime").value.variantdate)

 

thanks,

 

Yustas 

0 Kudos
Message 3 of 4
(3,670 Views)

Hi Yustas,

 

Note that if you request the DateTimeObject.VariantDate, then you are losing the millisecond and microsecond and nanosecond information stored in the DateTimeObject.  You can alternatively request the entire object and read that info off as properties, if you need it...

 

Set Prop = ResultsList(1).Properties("DateTime")
Set DateTimeObject = Prop.Value
MsgBox DateTimeObject.Millisecond

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 4 of 4
(3,646 Views)