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

Hi, I am using this calculation in portal which calculates days in portal  Date - (GetNthRecord ( Date ; Get ( RecordNumber ) - 1 ) )

how can i modify or do something else to avoid (?) in the first row.  Sample file attached for any modification/help.

Thanks for any help

DateCalc.fmp12

What's are you wanting this calculation to do?

The result shown in the field is hit and miss on what it is displaying.

 

DateCalc.png

  • Author

I want the difference between two dates (days). The solution i am working is about submitting applications by person on different dates and report on how many days have past since the last submitted application date. 

This sounds like a timesheet, have you tried Start Date and End Date and elapsed time?

It is getting an error on the first entry for each ID where there is no Nth record to get the previous date from.

  • Author
1 hour ago, Aussie John said:

It is getting an error on the first entry for each ID where there is no Nth record to get the previous date from.

yep thats the problem. is their any other calculation to get days between dates in portal rows.  something like which starts calculating from second portal row and ignore the first row or put the calculation in second row.

some calculation like    ....Calculate the days between portal rows and don't calculate the first row or blank if dates are same.

I can’t test this but

case(GetNthRecord ( ID ; Get ( RecordNumber ) - 1 ) =ID,

Date - (GetNthRecord ( Date ; Get ( RecordNumber ) - 1 ) ),

0)

there are probably more elegant solutions

  • Author
1 hour ago, Aussie John said:

I can’t test this but

case(GetNthRecord ( ID ; Get ( RecordNumber ) - 1 ) =ID,

Date - (GetNthRecord ( Date ; Get ( RecordNumber ) - 1 ) ),

0)

there are probably more elegant solutions

the result is always zero 0 i will try the case statement with different setting  thanks for helping

Ash

Sorry my error the reference to ID should be person ID ( ID_person) not the Date record ID which is irrelevant

Temporarily, to see your results change instantly it helps if Datecalc is unstored

 

Case(GetNthRecord ( Date::id_Person ; Get ( RecordNumber ) - 1 ) =Date::id_Person;

Date::Date - (GetNthRecord ( Date::Date ; Get ( RecordNumber ) - 1 ) );

0)

I should add that a change in the sort order will ruin your results.

Edited by Aussie John

  • Author

Thanks Aussie John for help the case statement solved the problem here is my screenshot of original solution (the dates are local i mean not Gregorian calendar )

datecalc.JPG.df7720e6b271f5c5fb35a2a3ac4113dc.JPG

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.