March 23, 200718 yr 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?
March 23, 200718 yr The calc needs to return a text result, not a date. Edited March 29, 200718 yr by Guest I see now that I misread the question -- you already figured this out.
March 23, 200718 yr 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 ) )
March 23, 200718 yr 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!!
March 23, 200718 yr startDate * EndDate = 0 is a control to verify that no date field is empty ---------- startDate = EndDate is the same control of your calc
Create an account or sign in to comment