Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Sorting Records in the Selected Month

Featured Replies

Hi,

I finished my medical database, but need some small adjustments. First of all how can I make a list of patients in a selected month.

For example: Selecting list button will show a custom dialog "chose year and month" then the list of patients will be shown whom were operated in that selected month.

Hi Tolga,

What is the table that you to store patient operation records? That would be the table in which you'd do a Find.

You really don't need to build a dialog with select year and month. That is more slick, but a simple Find layout will allow perhaps even more search criteria to be entered (Year, Month, Operation Type, Age, etc.).

If you go the dialog route, I'd create a layout with two globals that each have value lists. gYear and gMonth (appropriate value lists).

The layout would have two buttons, "Show Patients" and "Cancel".

"Show Patients" would run a script that Finds in the table that stores the records, using the Enter Find Mode, 2 Set Fields using the globals, Perform Find construct.

If no records are found, the user is returned to their starting layout.

2 Set Fields

??

http://www.fmforums.com/forum/showtopic.php?tid/212795/

Good catch, Michael. Thanks. I need to slow down on these "quick" answers.

  • Author

I couldn't manage to make that script. I think it' s too compicated for a amateur like me. Can you post an example please.

I desined something like this:

-make a "monhly operation list" button.

-this button will navigate a layout containing two (popup) fields. Select "month" and select "year". And a "list" button to perform script.

-the scipt will sort the operations in that selected monht in list view.

Waiting for your help at this momnet..

Than you

Have you looked at the link comment posted? It has the script/design that you need.

  • Author

Yes, I' ve looked at it but couldn' understand it.

[color:blue]Set Field [ Projects::Date ; Date ( Projects::gMonth ; 1 ; Projects::gYear ) & ".." & Date ( Projects::gMonth +1 ; 0 ; Projects::gYear ) ]

Perform Find []

-For example I didn' t understand ".." does it mean to write for the other 11 months?

-also confused about gMonth and gYear. do they represent the two new fields of month and year?

Edited by Guest

gMonth and gYear are two global fields that you'll put on a layout that serves as an input dialog. The user will enter values in these fields (each will have a value list attached), and click a find button.

The script takes the values in gMonth and gYear and performs a find in Projects in the Date field. The Set field when evaluated might look like this if the user selected gMonth = Jan and gYear=2010:

1/1/2010..2/1/2010

This is Filemaker's way of finding a date range. The ".." is in quotes, and is a literal string.

Read about [color:blue]Finding ranges of information in your User Guide and / or Online Help when FileMaker is open.

This is a very basic need in finding records, so the more you understand how this works, the better off you will be.

HTH

Lee

  • Author

Yes you're right. I need some basic information. But I have a limited amount of time because of my job. So your answers and examples to my questions are very helpful to me.

I'm making a DB for my personal needs in my job (heart surgery). It's nearly finished (I' ve started to enter data). But need some small adjusments like this one. So your answers are saving my days.

I' ve modified the set field step acording to my DB. But "an operator is needed" dialog apears. I' m trying to find the error.

Attach a copy of your file.

  • Author

This is my file.

KVC_Database.zip

Tolga,

Forget the scripted find. Just learn how to do a find for a date range.

Barbara

I been trying to attach a modified copy of file, but it isn't uploading for some reason.

Your script should look like this.

FindMonth

Enter Find Mode [ ] Set Field [ KVC Veritabanı:):Yatış Tarihi;

[color:blue]Date ( KVC Veritabanı::gMonth ; 1 ; KVC Veritabanı::gYear ) & ".." & Date ( KVC Veritabanı::gMonth +1 ; 0 ; KVC Veritabanı:: gYear )

]

Perform Find [ ]

Note: you have to put data in your global fields. i.e. gMonth the number for the month, 1, 2,3, - 12 and gYear equals 2010 or whatever the year is that you are searching for.

HTH

Lee

Edited by Guest

  • Author

Thank You Mr. Smith and Barbara (and also Michael). I' ve solved all my problems. And now managed to make that script (with your help of course) and some extra layouts to peforme find operation. It works fine.

See you in my next trouble.

Won't take too long I think.

Tolga

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.