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

  • Newbies

I have created a field called Current Semester with the following calculation:

If (Get ( CurrentDate ) ≥ Date ( 7 ; 1 ; Year ( Get ( CurrentDate ) )) and Get ( CurrentDate ) ≤ Date ( 12 ; 31 ; Year ( Get ( CurrentDate ) ) ); "First"; If (Get ( CurrentDate ) ≥ Date ( 1 ; 1 ; Year ( Get ( CurrentDate ) )) and Get ( CurrentDate ) ≤ Date ( 6 ; 30 ; Year ( Get ( CurrentDate ) ) ); "Second";""))

My computer clock is set at 8/28/2011. Of my 519 records, 20 say "First" and the rest say "Second". i do not understand why all the records do not say "First".

Thanks for any light!!

Rachael

I will re-write your expression to be a bit easier to read:


If (

Get ( CurrentDate ) >= Date ( 7 ; 1 ; Year ( Get ( CurrentDate ) ) ) and

Get ( CurrentDate ) <= Date ( 12 ; 31 ; Year ( Get ( CurrentDate ) ) ) ;

"First";

 

If (Get ( CurrentDate ) >= Date ( 1 ; 1 ; Year ( Get ( CurrentDate ) ) ) and

Get ( CurrentDate ) <= Date ( 6 ; 30 ; Year ( Get ( CurrentDate ) ) ) ; "Second" ;

 

""

)

)



 

 

It seems that you are saying:

 

if date is between 1 July and 31 December then return "First" else

if date is between 1 January and 30 June then return "Second"

 

Much better to use the Case function instead of nested IFs. Also consider that the result should be "Second" if it's not "First...

 

 



Case (

 

Get ( CurrentDate ) >= Date ( 7 ; 1 ; Year ( Get ( CurrentDate ) ) ) and

Get ( CurrentDate ) <= Date ( 12 ; 31 ; Year ( Get ( CurrentDate ) ) ) ;

"First";

 

"Second"

)



 

EDIT: Actually you could probably do away with the "<=31 December" expression too.

 

 



Case (

 

Get ( CurrentDate ) >= Date ( 7 ; 1 ; Year ( Get ( CurrentDate ) ) ) ;

"First";

 

"Second"

 

)

Also: make sure the calculation is set to be UNSTORED.

How about =

Case ( Month ( Get ( CurrentDate ) ) ≥ 7 ; "First" ; "Second" )

Actually, Rachael's calculation works so lack of updating was probably due to not checking 'Do not store calculation results' in the Storage Options so it will update. But I'm glad she posted so she could get some better calc examples and an explanation from Vaughan. :yep:

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.