Nov 18 2008, 09:14 AM
I have a date field with the format "20010925" or "yyyymmdd" and need to this change. it's currently a text field and I need it to be a date field with the format mm/yyyy. Any ideas on how to change this? Thanks for your help!
Nov 18 2008, 09:25 AM
You want to use the Left and Mid functions. But, your new format of "mm/yyyy" is not a proper "date field".
NewValue = Mid(YourField,5,2) & "/" & Left(YourField,4)
That will save it to a String Variable, and work if the Month is ALWAYS 2 digits.
For a proper Date Field:
NewValue = CDate(Mid(YourField,5,2) & "/" & Right(YourField,2) & "/" & Left(YourField,4))
Nov 18 2008, 10:03 AM
Ok, great! I will try that. Thanks for your help!