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

Each record in my database has a field "Project Number"

Multiple records can/do have the same Project Numbers.

I want to define a field that will indicate if a particular record is one of the 3 most recent entries with that Project Number. Does that make sense? Thanks,

Tim.

I'll have to think some about this one. The latest records is easy. Create a self relationship based upon project number. Create a calculation field equal to Status(CurrentRecordID) and call it "CurrentRecordID". Create a flag for latest record:

Flag (calculation, number) =

CurrentRecordID = Max(SelfByProject#::CurrentRecordID)

This will flag the newest record for that Project Number.

Now, how to do the latest three....to identify the first three is again easy using separate serial numbering for each project (SetField(ProjectSerial, Max(SelfByProject#::ProjectSerial) + 1) for a new record.

I suppose this could be combined with the Max function to identify the last three as Max(SelfByProject#???:ProjectSerial), Max(SelfByProject#???:ProjectSerial) - 1, and Max(SelfByProject#???:ProjectSerial) - 2.

A combination of Project# and ProjectSerial would uniquely identify these records.

-bd

Errr, this might be too obvious: the last three records in the database when it is unsorted?

quote:

Originally posted by timmy:

Each record in my database has a field "Project Number"

Multiple records can/do have the same Project Numbers.

I want to define a field that will indicate if a particular record is one of the 3 most recent entries with that Project Number. Does that make sense? Thanks,

Tim.

Timmy,

That sounds like a report to me. You have a whole group of records and you want to find the last three of a particular project (number). If this is what I want to do, then I would create a field (date type), and set it to auto enter the creation date, and create another field (time type) and set to autoenter the creation time. So everytime I create a record it automatically generates value(s) in the calculation field that records the date and time it was created. Then if I wanted to see the last three records, I would find all records with the project number and sort by the date and time fields, and view the results. Voila!!

I think the requirement was to mark the last three entries of each project, not just find them. Say you want to find the last three entries for all 1500 projects in an 150,000 record file, using a find/sort by project would be a little prohibitive. I suppose you could reprocess all the records for a specific project every time you entered a new record:

Find project

Unsort

Go to Record/Request/Page (last)

Set Field (Mark, 1)

Go to Record/Request/Page (previous)

Set Field (Mark, 1)

Go to Record/Request/Page (previous)

Set Field (Mark, 1)

but this could be a little slow.

-bd

  • Author

LiveOak is right. I want to mark the last three records of each project number, not just find them. I have this functioning for the last record:

there is a relationship "SelfProjectNum" that relates the ProjectNumber in the database to itself. the field that marks the last record of each project number is named "Latest"

"Latest" is a calculation:

Max(SelfProjectNum::counter)=counter

where is counter is an increasing serial number on each record.

this works perfectly returning 1 (true) if the record has the max counter and 0 (false) for all others.

how do i do this with the THREE latest is the problem. hope this clarifies what i want to do. thanks for all the help,

timmy.

Ok, how about:

Latest3 = (Max(SelfProjectNum::counter)=counter) or

(Max(SelfProjectNum::counter) - 1 =counter) or

(Max(SelfProjectNum::counter) - 2 =counter)

  • Author

hehe, yeah. thanks. i thought of that after my last posting. seems pretty obvious. thank you,

tim.

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.