January 28, 200322 yr Newbies Morning all - I have a time field that I'd like to able to search with. By hand I can enter "<14:00" to mean earlier than 2pm which works fine but I can't seem to script the same search. No matter how I try and get my script to enter "<14:00" or what function I try and pass it through it never makes it into the field during the search process. Any help or suggestions would be appreciated. Mark.
January 28, 200322 yr Are you using SetField in your scripts? If so, this will not work as Set Field requires the argument to be in the same format as the destination field. You need to use InsertCalculatedResult instead and also make sure you have un-checked all the restore options in the Find script steps - so your script might look like: Enter Find Mode [] Insert Calculated Result [Time Field, "<" & TimeToText(YourSearchTime)] Perform Find [] You can do a similar thing with ranges, so the middle step of the script would be: Insert Calculated Result [Time Field, TimeToText(StartTime) & "..." & TimeToText(FinishTime)] If you download the Handy Bits file in the samples section of this forum, there are a lot of example calculations for ranges (mainly date ranges) when using this script step.
January 29, 200322 yr Author Newbies Thank for the reply Russ. But that didn't seem to help my case at all. Let me show you whats going after your suggestions. Insert Calculated Result [select, "StartTime", ""<" & TimeToText ("14:00")"] The idea being to try and find all records with a start time earlier than 2pm. I've put a Pause command after that Insert to see what it actually inserts into the find request. The field StartTime gets populated with "<0:23:20" but without the quotes. Can you tell me where I'm going wrong ?
January 29, 200322 yr I don't think you need to use the timeToText function... just "< 14:00" should be sufficient, because it's just inserting text as if you were typing... but if you do use the TimeToText function, it would probably have to have the Time function embedded like this: TimeToText( Time(14,0,0) )
January 29, 200322 yr If you want to hard-code the 1400 time, then use this script step. Insert Calculated Result [select, "StartTime", ""<14:00:00""] My post assumed that you were selecting a time from a field, rather than hard coding it.
Create an account or sign in to comment