Jump 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.

Featured Replies

Gents, when I evaluate ExecuteSQL in DataViewer - it is working, but when I attach this calculation to field - it doesn’t! I receive a “?” instead.

 

Where am I wrong?

Instead of asking for guesses, why don't you post a demo file showing the problem (and preferably only the problem).

 

  • Author

I’m on iphone right now. Would you be happy with the screenshot?

15FF277C-DCCE-42FA-996B-75FC0610B971.jpeg

I am in no hurry...

The screenshot confirms what you told us - that your SQL expression works in the Data Viewer. It provides no clue to the reason why it fails in a calculation field.

Unrelated to your question, but I would be reluctant to use ExecuteSQL in a calculation field, mainly (but not only) for performance reasons.

 

  • Author

well, would you please offer an alternative to this formula?

Not without knowing the context and purpose.

 

  • Author

I need to count all the apartments with status “available”. 

  • Author

I need to construct a report, I guess “find” is not an option 

The "?" always means a syntax error.  And given that you can use the same syntax in the data viewer, it probably means a context error.

I'll reinforce what @comment said earlier: I would not use this kind of executeSQL in a field.  If you want to construct a report, run a script that does all your summarizing (and ideally pre-aggregate where you can based on time periods etc).

There are many techniques to make FM show the exact error, do a google for "filemaker sql debug" and you should find a few good pointers.

  • Author

Thanks, Wim. I'll follow your advice.

  • Author

Wim, I'd like to create a script and set the global variable $$countUnits. 

 

The question is: what function should I use to calculate this variable? 

 

Sum (Units::RentalUnitsStatus0or1) will count only one record.

5 minutes ago, stan111 said:

Sum (Units::RentalUnitsStatus0or1) will count only one record.

That depends on the context (which I asked about earlier, but did not receive an answer): if you are in the context of Units, then it will sum only the current record. From the context of a related table, it will sum all related records.

I think it's time to stop playing 20 questions. If you want to get useful answers, then explain in detail what do you have in terms of structure (tables, fields and relationships) and what kind of report you're trying to produce. These laconic one-liners are not helping you to get help.

 

  • Author

Attached is my app. I'd like to make a report with:

Total units = 3

Occupied = 2

Free = 1

Thanks for your patience. 

units.fmp12

  • Author

Thanks! I should've done it before!

Create an account or sign in to comment

Important Information

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

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.