Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Using Tap Forms 5 › Searching on date field: What am I doing wrong?
Tagged: search
- This topic has 7 replies, 2 voices, and was last updated 8 years, 11 months ago by
Brendan.
-
AuthorPosts
-
December 7, 2016 at 1:36 PM #20573
Dave BrittenParticipantI’ve got a form with a date field called “Discontinued”. I’m creating a saved search called “Current”, where I want to see any records that either don’t have a date in “Discontinued”, or that date field is blank.
I created a saved search with two conditions, and set to “Any”:
Discontinued is in the period: Today or after
Discontinued is emptyI have one record in the form, where Discontinued is empty, but it doesn’t show up when this search is active. If I remove the “Discontinued is in the period…” condition, it shows up with only the “Empty” condition present.
What am I missing?
December 7, 2016 at 3:04 PM #20574
BrendanKeymasterHi Dave,
I’m just investigating this issue now.
Thanks,
Brendan
December 7, 2016 at 4:10 PM #20575
Dave BrittenParticipantThanks Brendan. Also, to clarify, I’m using the iPad version, and this is specifically a “Date” field, not “Date & Time”, or any of the record timestamps.
December 7, 2016 at 4:49 PM #20576
BrendanKeymasterIt’s the same code that runs on the Mac version too for handling dates like this. It’s the ‘in the period’ search rule which is causing the issue. If you used an absolute date in the search rule then it would work as expected. E.g. Date is greater than 2016-12-07
December 7, 2016 at 5:41 PM #20578
Dave BrittenParticipantHmm, I see. In this case, I need the comparison to be relative to the current date.
December 7, 2016 at 8:10 PM #20581
BrendanKeymasterWhat you can do for now is to just create 2 saved searches. One that finds the empty dates, one that finds the “in the period” dates.
December 9, 2016 at 6:31 AM #20588
Dave BrittenParticipantI need to make sure I see all discontinued/non-discontinued items all at once, so that wouldn’t quite do it.
I think what I’ll have to do for now is use two fields: Discontinued (checkbox), and Discontinued Date (date), then do the filtering on the checkbox.
Related note: Is there a reference for calculated fields somewhere? Maybe there’s some clever way to use those for filtering that I haven’t stumbled across.
December 9, 2016 at 10:46 AM #20590
BrendanKeymasterThe topic for the Calculation field is here in the online manual:
-
AuthorPosts
You must be logged in to reply to this topic.