Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Finding records between dates and according to a criteria selected in a dropdown


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

Recommended Posts

Posted

Hi.
I have a database that lists grant applications.
I need for my user to be able to view the records in a number of ways according to certain criteria for analysis purposes. These records are displayed in a List layout.

I need to be able to:

1) see only records where the submission dates are between x and y

then

2)  filter these records according to what is selected in  2 dropdowns - Outcome and Status. The Outcome field dropdown value list is : <blank>, granted, unsuccessful, unknown. The Status field is  dropdown value list is: <blank>,submitted, in progress, finalised. The <blank> is where that dropdown criteria are not required.

Ideally, I'd like to be able to set the dates, select from the dropdowns and perform the find, but happy to do it in 2 steps if necessary.

I've tried several things from solutions found searching the internet, but nothing seems to work and I'm getting increasingly frustrated with it. I'm not a coder and anyone good enough to help me out here needs to be aware of this. While I've been using FM on and off for a number of years, I'm by no means an expert or even near it.

Thank  you in advance for any guidance with this. You guys have helped me out in the past.

Posted

I suggest you start by defining 4 global fields to hold your criteria -  gFromDate, gToDate, gOutcome and gStatus - and place them in the header part of your layout, next to a Find button. Make the button run a script that does:

Enter Find Mode []
Set Field [ YourTable::SubmissionDate ; "≥" & YourTable::gFromDate ]
Set Field [ YourTable::SubmissionDate ; "≤" & YourTable::gToDate ]
Set Field [ YourTable::Outcome ; YourTable::Outcome ]
Set Field [ YourTable::Status ; YourTable::gStatus ]
Perform Find []

That's a rough sketch, there are many variations and embellishments possible.

Posted
2 hours ago, comment said:

 



Set Field [ YourTable::SubmissionDate ; "≥" & YourTable::gFromDate ]
Set Field [ YourTable::SubmissionDate ; "≤" & YourTable::gToDate ]

 

That wouldn't work. The second set field would overwrite the first set field.

Set Field [ table::SubmissionDate; Table::gFromDate & "..." & Table::gToDate ]

would work.

 

Posted
3 hours ago, OlgerDiekstra said:

Set Field [ table::SubmissionDate; Table::gFromDate & "..." & Table::gToDate ]

Oops, I don't know where my head was. Thanks for the catch.

Posted

Hi. Thank you for the help so far :)

I already had the globals.

I started to create the script but when I added the following into the Calculated Result for Set Field, I got the message saying an operator was expected:

Grants::Date Submitted;Grants::gSubmittedFromDate &"..."& Grants::gSubmittedToDate

Any thoughts?

 

Posted

You must be doing something wrong. It works just fine for me:

image.png.947507b7254bfcbd76dc225613f7e331.png
Maybe post a screen shot of what you're trying to do.
Posted

Still get the same error - just trying to get the dates thing worked out .

Screenshot attached.548175727_ScreenShot2019-02-28at4_21_28pm.thumb.png.0102c4e787663e526d8e6c667038dcb6.png

Posted

The Set Field step has two parts.

Grants::Date Submitted is the field you want to set; you select it when specifying the target field.

When specifying the calculated result, enter ONLY this into the calculation window:

Grants::gSubmittedFromDate &"..."& Grants::gSubmittedToDate

 

Posted (edited)

Thank you so very much for your help - as soon as you explained it I realised how obvious it was. I must have been so far down the rabbit hole that I could no longer see the obvious.

I was just going through the file in a final check and realised on my global summary layout, I still have an issue with a date thing.
I want to show the date of the first record entered and a date of the last record entered. I've done a Summary field for Min and one for Max but nothing shows up in the live view.

Any thoughts?

Screen Shot 2019-03-02 at 11.45.56 am.png

Screen Shot 2019-03-02 at 11.42.29 am.png

Edited by DreadDamsel
Posted

Why not simply use gSubmittedFromDate and gSubmittedToDate? That is  the date range they've entered to search, if you showed them different dates, they might get confused, and think the system is doing something odd.

Posted

This is a different purpose - it's simply displayed information, not entered. It's the date the first record is created and the most recent date a record has been created - this date is auto-filled on creation of a new record.

It displays on a different layout.

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