Help needed concerning view Time search

Hi to you all,

I am currently trying to do a search with the creation time of documents.

The client get the date and time from a managenow ticket, with a web parse,

and then fills to fields : Creation_date and Creation_Time, which are designed to

display respectively the date, and the time.

Btw, the fields are filled from a LS agent, that converts the HTML text to NotesDateTime(s).

We are able to search for a date range, but unable to search neither for specific time, nor for a time-range.

I am right now thinking about creating a new computed field, translating the time one to another numeric one, but not

sure at all that it will work or be easy to use for my customers…

Is it a known bug ? Does anyone experienced it ? … had a work-around ?

Thanks a lot for help.

ian

Subject: Help needed concerning Time search

Ian,

I might be able to help more if I knew how you were taking the date value from managenow and creating your NotesDateTime object. Also, I am trying to understand why you would want to do a search on a time…I suppose that if I wanted to find tickets created at a specific time of the day, I would create a second NotesDateTime object and make it equal to today’s date plus the time you are looking for, so for example, if you were looking for all tickets created at 2pm you would do something like this:

Dim dt as New NotesDateTime(“Today 2:00PM”)<–sets NotesDateTime object equal to today at 2pm

Then use your current NotesDateTime object to figure out the time difference. So if we have another DateTime object for created date + time called cdt, we’d do something like this:

dim timeDif as Long

timeDif = dt.TimeDifference(cdt)

Then to figure out if you have found a match, mod timeDif by 84600 (which is the amount of seconds in a day) to find out if your remainder is 0. If it is, then you have found a match, because the number of seconds would have to be divisible by 84600 to work.

Something like this:

If timeDif mod 84600 = 0 then

…you have a match

End If

If you are trying to find a specific date and time, you would need to know the amount of days between today and the created date, and then multiply 86400 by that number to find the exact date.

Then again, i could have completely misread what you are trying to accomplish. Maybe more detail will give me a better idea of your goals.

hth.

brandt

Subject: RE: Help needed concerning Time search

Hi

Honnestly, I have NO goal, but my manager does.

He only wants to be able to do a view search by field, with no specific agent, or so…

The workaround I found is to add a computed field like that, 1000000+@TextToNumber(@ReplaceSubstring(@Text(Creation_Time);“:”;“”))

then a search for a date AND creation_time is between 1000000, 109000000 (from 00am to 09am) will work.

It is the quicker I’ve found.

Remark : My question were, more precisely, about the field time search in a view (which seems to not work)

and any work-around.

Btw, I am able to search for what I want with an action/agent, but I’m not sure at all that my manager would accept

to bother himself with some too complicated things.

Thanks for the answer.

Subject: Help needed concerning Time search

Can you show the part of the LotusScript where you perform searching and what results do you get on sample values?

Subject: RE: Help needed concerning Time search

Hi back

I’am talking about a view search, sorry for not specifying.

ian

Subject: RE: Help needed concerning Time search

2 years ago I tried to accomplish similar time search, but ended up with converting date+time to a number and comparing numbers instead. Not sure if there is a way to make it work “natively” with time fields by using > and < search operations, = worked fine.