1

I have thousands of records to go through and I need to pull out a specific date. Heres the set up of the fields one field is full of Null values and the second field is an ID field that looks like this XX_01052001_092045. The first part is a set of letters, the next is the date being MMDDYYYY. The third part is the time, all I want is to pull out the date and put that into the field full of null values. However the format that is requested is that the new date look like this MM/DD/YYYY. Is there a way to use the field calculator and parse this out?

  • 2
    What program you use? – Matte Jun 28 '16 at 20:54
  • I am using ArcMap 10.3.1 – gdenise92 Jun 29 '16 at 11:45
1

Depending on if your data is all formated the same way you can use the following directly in the field calculator with the VBScript parser activated:

mid([ID],3,4) & "/" & mid([ID],5,6) & "/" mid([ID],7,10)

If your ID is not always the same you can search for the position of the underscore with the InStr function like:

mid([ID],InStr([ID], "_", InStr([ID], "_")+2)

Please comment if you need it to be python. Just took the vb approach from memory.

  • Python would be more help here probably – gdenise92 Jun 29 '16 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.