Skip to main content
Solved

Change Attribute from Text to Datetime field

  • 20 February 2024
  • 1 reply
  • 68 views

When we had some attributes created 2 of our date fields were created using Text rather than DateTime

I have been through some articles mentioning using CDATE, however I have not been able to get this to work yet. The final aim is to be able to sort by Contract End date DESC in the Customers GI.

Is there a way to do this without recreated the fields?

 

Best answer by darylbowman

ryonxan wrote:

Is there a way to do this without recreated the fields?

Yes and no.

You should be able to convert a correctly formatted string to a date with CDate(), but since you have no validation on your field, anyone could enter anything, therefore probably giving you errors when attempting to convert.

You could create new date attributes and attempt to copy the values from the current string attributes to the new date attributes, but this is magnificently complex.

View original
Did this topic help you find an answer to your question?

1 reply

darylbowman
Captain II
Forum|alt.badge.img+13
  • 1608 replies
  • Answer
  • February 20, 2024
ryonxan wrote:

Is there a way to do this without recreated the fields?

Yes and no.

You should be able to convert a correctly formatted string to a date with CDate(), but since you have no validation on your field, anyone could enter anything, therefore probably giving you errors when attempting to convert.

You could create new date attributes and attempt to copy the values from the current string attributes to the new date attributes, but this is magnificently complex.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings