Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to Search on a Time Field using Script Steps 1

Status
Not open for further replies.
May 12, 2006
1
IN
Hi,

Trust you are doing well. I am Satish working on a project using FM. I am unable to search or do a find on field "Updated Time" datatyped as Time from a script. The time range which I want to search is calculated as
Status(Current Time)&"..."&Last_Run_Time.
I tried using Insert Calculated Result, Set Field and Combination of Copy Paste commands but in vain.

I would appreciate your help and suggestions.

Thanks & Regards,
Satish
 
Satish,

The fact that you have used the syntax:

Status ( CurrentTime )

tells me that you are on an older version--probably version 6 or earlier. In v8 the same function is called:

Get ( CurrentTime )

I only bring this up because I am on v8 and my memory for earlier versions is fading and I know that the date and time searching had changed a bit in later versions.

With that disclaimer out of the way what you might want to try is converting the time to text for the search. Your script will look something like this:

Enter Find Mode []
Set Field ["Time_Field", "GetAsText ( Status ( CurrentTime ) ) & "..." & GetAsText ( Last_Run_Time )"]
Perform Find []

In the example above the function:

GetAsText ( text )

is different in version 6. I can't remember the exact syntax but there is an equivalent function.

One other possibility would be if the field were accidentially formatted as TEXT rather than TIME.

-Striker
 
In FM 6 :

TimeToText ( time )
Returns the supplied time as data of type Text, for use with formulas involving text or text functions. The format of the text result depends upon the time format when the database was created.


TextToTime ( text )
Returns times in text as data type Time, for use with formulas involving time or time functions. The format of the supplied time must be the same as the time format on the system were the file was created.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top