Jump to content
Sign in to follow this  
Tombstone0

Date Search

Recommended Posts

I have two fields labeled start date and end date in a paid time off database for my company. I need to be able to search for any request that encompasses a specific date such as >StartDate and <EndDate, but when I attempt to enter the < or > symbols into the field I get an error because they're not dates is there anyway to enter these into the date fields in find mode in a calculation.

Thanks

Share this post


Link to post
Share on other sites

The way I've done such things is to create another field that flags when the situation is true. In other words, lets say that I often need to search for when My_Date is greater than Start_Date. I'll create a third field called perhaps Is_Late which is a calculation field with a number result set to:

My_Date > Start_Date

If My_Date is greater than Start_Date, this field will have a value of 1. If it isn't, this field will have a value of 0. Then I can search (perhaps using checkboxes tied to a value list with a 1 in it) to search for that criteria.

Chuck

Share this post


Link to post
Share on other sites

Here's a method that I've used with more complicated searches. I would appreciate it if you gurus would comment on any performance penalties, since my file tends to have relatively few records in the 100s and I don't see any real performance hits:

Add a field to each record that I call FLAG (numeric). Have a script loop thru all the records in the datafile. Set Flag = 1 if your tests are met, else set to '0'. In a script, your tests can be very complex, but easy to write. Then all you need to do is a simple find on the FLAG field where Flag = 1.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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