Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7968 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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.

Posted

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.

  • Newbies
Posted

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 ?

Posted

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) )

Posted

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.

This topic is 7968 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.