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.

Date Calc Help

Featured Replies

I have a string named strStartEndDate that looks like this:

StartDate&" - "&EndDate

In some cases the start and end dates are the same so I needed a calc to make sure that only one date in the string shows up if they are the same dates. So, I created this calc:

If(StartDate=EndDate; StartDate; strStartEndDate)

The format for the date needs to be Month Date, Year (August 7, 2006).

Here's my problem. If the two dates do equal one another the calc works great and the date shows up formatted as I need it. However, if the two dates don't equal the only format that will display is as such:

3/11/2007 - 3/14/2007

I need it formatted as mentioned above. if I go in and manually force it to format like I want I get a ? when the results are shown.

Any ideas?

The calc needs to return a text result, not a date.

Edited by Guest
I see now that I misread the question -- you already figured this out.

Hi

give a try to this calc ( result text );)

Case(

startDate * EndDate = 0 ; "" ;

startDate = EndDate ;MonthName ( startDate ) & " " & Day ( startDate ) & ", " & Year ( startDate );

MonthName ( startDate ) & " " & Day ( startDate ) & ", " & Year ( startDate ) & " - " & MonthName ( EndDate ) & " " & Day ( EndDate ) & ", " & Year ( EndDate )

)

  • Author

Danielle,

That worked beautifully. Thank you.

Could someone be kind enough to explain the first part of this script?

Case(

[color:red]startDate * EndDate = 0 ; "" ;

startDate = EndDate ; MonthName ( startDate ) & " " & Day ( startDate ) & ", " & Year ( startDate );

MonthName ( startDate ) & " " & Day ( startDate ) & ", " & Year ( startDate ) & " - " & MonthName ( EndDate ) & " " & Day ( EndDate ) & ", " & Year ( EndDate )

)

I completely get that last part but the first section doesn't compute with me just yet. And, yes, I'm a newbie.

Thanks!!

startDate * EndDate = 0

is a control to verify that no date field is empty

----------

startDate = EndDate

is the same control of your calc

Wouldn't 'Do not evaluate if all referenced fields are empty' do the job?

No

OK.

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.