Searching on date field: What am I doing wrong?

Tap Forms – Organizer Database App for Mac, iPhone, and iPad Forums Using Tap Forms Searching on date field: What am I doing wrong?

Tagged: 

Viewing 7 reply threads
  • Author
    Posts
  • December 7, 2016 at 1:36 PM #20573

    Dave Britten
    Participant

    I’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 empty

    I 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

    Brendan
    Keymaster

    Hi Dave,

    I’m just investigating this issue now.

    Thanks,

    Brendan

    December 7, 2016 at 4:10 PM #20575

    Dave Britten
    Participant

    Thanks 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

    Brendan
    Keymaster

    It’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 Britten
    Participant

    Hmm, I see. In this case, I need the comparison to be relative to the current date.

    December 7, 2016 at 8:10 PM #20581

    Brendan
    Keymaster

    What 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 Britten
    Participant

    I 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

    Brendan
    Keymaster

    The topic for the Calculation field is here in the online manual:

    https://www.tapforms.com/help-mac/5/en/topic/calculations

Viewing 7 reply threads

You must be logged in to reply to this topic.