1 Reply Latest reply on May 3, 2013 6:51 AM by philmodjunk

    Need help with the "MonthName" function

    Jan-NicholasKamke

      Title

      Need help with the "MonthName" function

      Post

           Anyboy out there to help me?

           I though I'm understanding the "MonthName" function, but obviously I don't.

           If I have a "Event Date End" field as a date field with drop down calendar to choose the date, and a calculation field, returning text, called "Month" with the calculation:

           Month = MonthName (Event Date End)

           I should get back "January" or "February" etc. depending on the "Event Date End" field. Correct? But in fact, I'm only getting "1", "2", etc.

           What I'm doing wrong??? Or misunderstand?

           What I'm trying to do is to create a string of event duration text for reporting, invoicing etc.

           I have a table of events, with a "Event Start Date" field and a "Event End Date" field. Both set-up as date field, with a drop-down calendar. I want to create a text string in a third field called "Event Duration", set up as  calculation field as text, returning either:

           "January 14 ~ 15, 2009"

           or

           "January 25 ~ Febrary 5, 2009"

           or

           "December 30, 2008 ~ January 5, 2009"

           I have therfore made the calculation for the "Event Durtion" field like this:

            

      Case (

      Event Date Start = Event Date End ;

      MonthName ( Event Date End ) & " " & Day ( Event Date End ) & ", " & Year ( Event Date End ) ; 

            

      Month ( Event Date Start ) = Month ( Event Date End ) and Year ( Event Date Start ) = Year ( Event Date End ) ; 

      MonthName ( Event Date Start ) & " " & Day ( Event Date Start ) & " ~ " & Day ( Event Date End ) & ", " & Year ( Event Date End ) ;

            

      Month ( Event Date Start ) ≠ Month ( Event Date End ) and Year ( Event Date Start ) = Year ( Event Date End ) ;

      MonthName ( Event Date Start ) & " " & Day ( Event Date Start ) & " ~ " & MonthName ( Event Date End ) & " " & Day ( Event Date End ) & ", " & Year ( Event Date End ) ;

            

      MonthName ( Event Date Start ) & " " & Day ( Event Date Start ) & ", " & Year ( Event Date Start ) & " ~ " & MonthName ( Event Date End ) & " " & Day ( Event Date End ) & ", " & Year ( Event Date End )

      )

            

           The calculation works perfect with the only set back, that the months are numbers...

           I'm working on a MAC and have tried all kinds of date settings of the OS, with no success.

           What I'm doing wrong?

           Any suggestions will be highly appreciated.

           japanik