Converting a Date
-
- Posts: 2
- Joined: Tue Oct 10, 2017 12:44 pm
Converting a Date
My database vendor changed its dates, as the Year 2000 approached, to read (for example) A10221 for 2001-02-21. The A represents "200" and the digit to the right of the "A" is the 1 in 2001. Do you know how I can convert this type of date to read like a normal "21-February-2001" or some other friendlier date format?
=> RE: Converting a Date
You would use the SUBS()function to extract each part of the date and then use the CTOD() function to turn that string back to a character. the expression:____CTOD(SUBS(BASE,3,2)+"/"+SUBS(BASE,5,2)+"/"+__STR(IIF(LEFT(BASE,1)="A",2000,1900)+VAL(SUBS(BASE,2,1)),4))____will return a date field from that you can then format in any of the available date formats.____In this expression you would replace BASE with the actual name of your database field. The calculation also assumes that any non-A initial character means a year in the 1900^s so you might also need to revise that part if that is not the case.____Kathleen__R&R Support__
-
- Posts: 2
- Joined: Tue Oct 10, 2017 12:44 pm
==> RE: Converting a Date
Kathleen, you^re a Wizard! Thank you-