jbullydawg Posted March 23, 2007 Posted March 23, 2007 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?
Fitch Posted March 23, 2007 Posted March 23, 2007 (edited) The calc needs to return a text result, not a date. Edited March 29, 2007 by Guest I see now that I misread the question -- you already figured this out.
Raybaudi Posted March 23, 2007 Posted March 23, 2007 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 ) )
jbullydawg Posted March 23, 2007 Author Posted March 23, 2007 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!!
Raybaudi Posted March 23, 2007 Posted March 23, 2007 startDate * EndDate = 0 is a control to verify that no date field is empty ---------- startDate = EndDate is the same control of your calc
comment Posted March 23, 2007 Posted March 23, 2007 Wouldn't 'Do not evaluate if all referenced fields are empty' do the job?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now