Outlk 2k3 Script: Find and findNext use

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Hi all,

I try to use the find funtion comapring 2 properties

I want to add to my listbox all items that mileage
is greater than 50000 at a specific day then pb is
that ceationtime is like dd/mm/yyyy hh:mm:ss
so i want to use date() function to convert the
creationtime to dd/mm/yyyu

item.mileage > Var1 and the item.creationtime= Var2

set myItem = Items.Find("[mileage] > """ & myvar1 & """ and
date(myitem.creationtime) = """ & myVar2"""")

I tryed many sintax but no one work

tks for help
 
The Date function either sets or retrieves the system date. It doesn't do
anything close to what you want to do. You also can't use seconds in a Find
or Restrict.

The Help on Items.Restrict lists all the properties you can't use for a
filter and shows some pretty good examples of filters you can use. For what
you want it probably would be something like:

sFilter = "[Mileage] > " & Var1
sFilter = sFilter & " And [CreationTime] = '" & Format(Var2, "ddddd h:nn
AMPM") & "'"
Set myItem = Items.Find(sFilter)
 
Back
Top