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

Using date range to select records

Featured Replies

  • Newbies

I am attempting to select records where a particular field falls between two dates (defined in other fields). Yet I can't seem to get it to work. I have used several different versions of

PurchaseDate > BeginningDate and PurchaseDate < EndingDate

inside an If construction. If this is true, I skip to the next record inside a Loop. It it is not, the record is Omited.

Any suggestions would be appreciated.

This sounds about right. I would add an Exit Loop If [not Status(CurrentFoundCount)] to ensure the loop doesn't omit all records and keep going.

What type of problem are you having with the loop?

hi Kevin!

Bob W. has posted a quick script that does what u need...I think!

here is a snip:

=========================

Enter Find Mode[]

Insert Calculated Result [Date,DateToText(g_StartDate) & "..." & Date To Text(g_FinishDate)]

Perform Find[]

Go To Layout [Whatever layout you choose to display the found records]

=====================

I hope it helps...

If it's a Loop problem, the commonest error is to put the Go To Next Record outside the If - End If, with the Omit inside.

This makes it go to the next record, even after it Omits one, so you end up skipping lots of records.

Omit by itself goes to the next record (try it manually). So you want to either Omit or Go to Next Record, not both.

Loop

If [ whatever ]

Omit

Else

Go To Next Record [ Exit after last ]

End IF

End Loop

(P.S. If the last record is Omitted, the previous record will get processed twice; because it's now the last record, and any processing generally happens before it exits. Which doesn't matter if all you're doing is looking for records.

When I'm actually doing something to the "kept" records, I use a incrementing global number field, compared to the original found count, in an Exit Loop If [ _gCounter = _gCount ].)

Same here. I didn't mention the omit error possibility because it seemed like he already had a good grasp of what he wanted to do.

If this is true, I skip to the next record inside a Loop. It it is not, the record is Omited.

Nice and succinct instruction on how to make these work as desired. You should copy this to that 'development standards' type forum, Fenton. grin.gif

  • Author
  • Newbies

Thanks. That worked great! A much better solution than what I was trying.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.