Jump to content

Find by date and Time range


devinh

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

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 [ ]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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