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.

Fine-tune Date Calculation Range

Featured Replies

Hi everyone,

Although I use GTRR for most date ranges, occasionally I need to perform finds (example, script for finding HireDate range) on smaller tables. I have about 15 situations in which I use this similar calc 'thinking'. I want them to be the best possible. Here are my two attempts:

Fields (all date)

DateFrom

DateThru

gFiscalStart (global pre-filled at host with our fiscal start)

gFiscalEnd (global pre-filled at host with our fiscal end)

My first calc (clunky)???

Case(

not DateFrom and DateThru; gFiscalStart & "..." & DateThru;

DateFrom and not DateThru; DateFrom & "..." & gFiscalEnd;

not DateFrom and not DateThru; gFiscalStart & "..." & gFiscalEnd;

DateFrom & "..." & DateThru

)

Fine-tuned calc (I think, although it doesn't appear to help much):

Case(

DateFrom;

If(DateThru; DateFrom & "..." & DateThru; DateFrom & "..." & gFiscalEnd);

not DateFrom;

If(DateThru; gFiscalStart & "..." & DateThru; gFiscalStart & "..." & gFiscalEnd)

)

But I keep wondering whether Let() can be used or simply a rearrangement of the calc. This is only an example and changes as my needs change but I'm hoping you can improve my thinking on it. Can this be improved even more?

LaRetta wink.gif

Your fine-tuned calc is not equivalent to your first calc. Also, I find mixing Case() and If() confuses me - but that is a personal thing. Anyway, how about:

Case ( DateFrom ; DateFrom ; gFiscalStart )

& ".." &

Case ( DateThru ; DateThru ; gFiscalEnd )

  • Author

Comment said ... Your fine-tuned calc is not equivalent to your first calc

Yes, I had changed it attempting to come up with a perfect example - sorry about that. crazy.gif

Yep!! Perfect and very very nice! And so simple, Michael. I can't believe I couldn't think of that!

I'm taking the day off and reviewing some of my calcs ... you know ... the ones that I've come up with by myself and I get an uneasy feeling every time I see them. wink.gif

Thank you!!

LaRetta

Why not just take a day off, period.

Neeeedsleeep.gif

  • Author

I actually slept in today! First time in 19 months! Slept 9 hours straight!! It was GLORIOUS!!

And for the first time in months, I'm able to study and work in FM without pressure to upload so it can be used immediately - that IS vacation, my friend. Plus took Ginger dawg for a hike and went swimming! Oh, and I'm going to sit down and watch XFiles - only show I like! Life is indeed wonderful! smile.gif

LaRetta

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.