Searching for Times and Dates

When selecting on times, dates and timestamps for an exact match you may not get the results you expect.

With regard to Dates, if you have set the date format to exclude the century digits and the century set in the configuration is 2000, then entering 01/23/96 will not find January 23rd, 1996 because 2000 is added to the 96, not 1900.

Similarly, with Time data, if you have suppressed the display of seconds in the configuration, and then select for an exact match of 10:43, you will not select the record that has its time stored as 10:43:15.  The seconds are always included in the record and when suppressed in the time entry field will default to 00.  Hence we looked up 10:43:00 and the failure to match was the result.  This problem can come about when you change to suppression of seconds display in “mid-stream”.  If you were displaying and entering seconds, and then switch to suppressing seconds, you will not be able to exactly match those whose seconds were not zero.

You can overcome this problem with a “bracketed” select.  On our example above, you could enter 2 criteria as follows:

StartTime is greater than or equal to 10:43 AND

StartTime is less than 10:44

This would include all times from 10:43:00 to 10:43:59 and the desired result would be achieved.

Of course, both comments apply to Timestamp field formats.