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

I have a FMP6 data base with a date field.

I want to define a new field (called Term) where the data is a calculation based on the date field:

ie if the data is within a range of dates eg between 30/1/06 and 30/4/06 (Aust format) then a number eg 1 goes in the Term field.

I can't work out how to write the If statement...

help please

Strictly speaking you don;t need an If statement... this expression will resolve to either 1 or 0. You only need an If to replace the 0 with null if that's what you prefer.

Term >= Date( 1, 30, 2006 ) and Term <= Date( 4, 30, 2006 )

  • Author

Hi Vaughan

Actually, I wanted to define the Term field for school terms ie Term 1, Term 2, Term 3 Term 4...I'm not sure if your response will work!

  • Author

So far the calculation is

(Term=)

_______

If(ASdate>=30/01/2006

and

ASdate<=30/04/2006,

1,

"")

_______

My problem is in defining the range

Once fixed I will replace ""

with another calculation for dates for Term 2

etc

I know its simple but I can't work it out!!

Are there qoing to be 4 equal terms, as in a fiscal quater?

  • Author

No

they're school terms

the start and finish dates change

  • Author

To clarify

I have an FMP6 related file with fields relating to student names, and detention dates (ASdate).

I have some layouts that summarise the data according to the school term.

I manually input the date of detention but I wanted to set up a calculation that would automatically insert the appropriate school term in another field based on a range of dates already inputted in the detention date field.

The calculation field is organised as previous posts but when I try to calculate within a range of dates I can't get a result.

Is this more complicated than I think it is?

Cheers

You are going to have to describe the start and end of your terms

I have used four fields, plus your Date Field and the calculation.

[color:blue]ASdate

Term1_Start

Term1_End

Term2_Start

Term2_End

All Date fields

TermCalc (Calculation, Number) =

Case( ASdate ≥ Term1_Start and ASdate ≤ Term1_End, 1,

Case( ASdate ≥ Term2_Start and ASdate ≤ Term2_End, 2 ))

You will need to modify this for additional Terms.

HTH

Lee

  • Author

Yippee (haven't used that word in a long time!)

Thanks Lee

  • Author

Lee

had to make them Global date fields to work how I wanted them to...still yippee

Stephen

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.