2 Replies Latest reply: May 8, 2012 9:58 AM by Przemysław Wojda RSS

    Odd datetime field behaviour

    Przemysław Wojda

      Hi All,

       

      In a script I got a datetime field which I cannot convert to date field. Strangly enough, I can make Year() and Month() out of it but when trying to make Date() or Date(Date#()) I arrive with datetime and nulls respectively. I thought it might have somehow be treated as a string but Left() brought me numeric date equivalent.

       

      Any idea what is going on and how to fix it?

       

      Regards,

      Przemek

        • Odd datetime field behaviour
          Oleg Troyansky

          If it's already a date field, then Date#() wouldn't work, but Date() should...

           

          Try to understand exactly what is the format of the loaded data - show the field in the list box and play with the Number formatting. What happens if you select "mixed"? What happens when you select "Integer"? What happens if you select "Date" or "Timestamp"? This way, you'll see if the field was loaded as a number or a text, or a date.