Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6516 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted (edited)

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

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 )

)

Posted

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!!

Posted

startDate * EndDate = 0

is a control to verify that no date field is empty

----------

startDate = EndDate

is the same control of your calc

This topic is 6516 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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