Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Odd datetime field behaviour

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

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

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.

Not applicable
Author

Hi Oleg,

I've tested format and eventually reloaded it as it was in the beginning with just a Date() ... and it worked. Now don't know whether to be happy that I made it or sad because I've no idea how 🙂 Thank you, anyway.

Regards,

Przemek