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

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

Recommended Posts

Posted

I need to right a script that will find our records by a set date and timie.

A day for us is considered 5am today untill 4:59am the next day. I've got two fileds that auto enter the date and one for time.

How can I tell in my search to find the records that belong to that day. It's the time part that's getting me.

I'm now thinking that I should have a time stamp field, would this help.

Thanks

Devin

Posted (edited)

Lets assume that this was yesterday start.

Enter Find Mode:

In the Date Field

≥ 9/19/2006

In the Time Field

≥5:00 AM

Should do it

Lee

Edited by Guest
find mode
Posted

Lets assume that this was yesterday start.

Enter Find Mode:

In the Date Field

≥ 9/19/2006

In the Time Field

≥5:00 AM

Should do it

Lee

That does not find the jobs that have todays date!

It needs to finds today also uptill 4:59am.

Devin

Posted

Then I missed understood your field setups. Do you have the following fields?

Date start [tab] Time Start [tab] Date End [tab] Time End

or

Date start [tab] Time Start [tab] Time End

If something else, spell it out.

Lee

Posted

Devin,

You can find the date range easily. Allow User to enter start date. Script would be:

Enter Find Mode [ pause ]

... user enters date

Modify Last Find

Set Field [ date ; date & ".." & date + 1

You can do the same thing with your time field. However, this type of AND find (that you require) will also find times overlapping that period. Timestamps will remove this problem entirely because they can span periods naturally. You don't need to change your process, just perform your find on a Timestamp field. To create one, create a calculation (result is timestamp) with:

Timestamp ( date ; time )

Still let User just search on date field. Your script would look like:

Enter Find Mode [ pause ]

... user enters date in date field

Modify Last Find

Set Field [ CALC ; TimeStamp ( date ; "5 AM" ) & ".." & TimeStamp ( date + 1 ; "4:59 AM" ) ]

Perform Find [ ]

Posted

Yes The time stamp was the key.

I made a new field for time stamp and I was able to make a simple script.

Get ( CurrentDate ) -1  & " 5:00  AM" & "..." & Get ( CurrentDate ) +1  & " 4:59  AM"

Thanks for the help.

Devin

Posted

Yes, I see you wanted to jump back a day. I also left a line out of my typed script. It should have been:

Enter Find Mode [ pause ]

... user enters date in date field

Modify Last Find

Set Field [ CALC ; TimeStamp ( date ; "5 AM" ) & ".." & TimeStamp ( date + 1 ; "4:59 AM" ) ]

[color:green]Set Field [ date ; "" ]

Perform Find [ ]

Once you start using TimeStamps, you'll never go back to separate fields. I explicitly used TimeStamp because I was concerned about system OS date/time setting changes within your file but it might not be necessary. I'm unsure if OS settings would be affected by timestamp changes.

Posted

Yes Time stamp is very nice, I started out using time stamp then I went to Date and Time thinking it would be easer for the users and I would have more control....

Thanks for your help guys and girls :

This topic is 6638 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.