{
  "id": "1998-february-converting-dates-in-access",
  "slug": "1998-february-converting-dates-in-access",
  "url": "https://dwillis.github.io/uplink/article/1998-february-converting-dates-in-access.html",
  "year": 1998,
  "month": "February",
  "monthNum": 2,
  "headline": "Converting dates in Access",
  "kicker": "TECH TIP",
  "author_name": "Richard Mullins",
  "author_title": "",
  "affiliation": "NICAR/The Missouri School of Journalism",
  "summary": "This article explains how to convert date information stored as character strings in Access databases into proper date data types using a two-step process involving string functions and the CVDate() function.",
  "keywords": [
    "dates",
    "conversion",
    "Access"
  ],
  "topics": [
    "Data & Databases",
    "Technology",
    "Investigative Methods"
  ],
  "technologies": [
    "Access",
    "FoxPro"
  ],
  "full_text": "One of the most common data cleanup needs is converting date information. The two-step process and the concepts for doing this are the same for FoxPro and Access. Arrange the numerals in mmddyy order and put in legal separators (hyphens or slashes) between month, day and year. This result may look like a date, but it's still a string of characters that you can't use for calendar math or date arithmetic. Step two is required to convert this correctly arranged date string into a date data type.\n\nThe only differences are in the details, which are minor, like the British and the American ways spelling \"realisation.\" Other Tech Tips have explained the FoxPro steps. This one will show the Access how-to.\n\nThe word string is used a lot when talking about computer databases. But it's not a technical term; it's a good metaphor that helps you think about what you can do with strings of characters - cut them apart and tie them together. String functions are what you use for the cutting apart. The ampersand symbol is how you tie pieces together.\n\nYou only need two string functions: one that picks out a certain number of characters starting from the left, and another that picks out a certain number of characters starting anywhere in the string.\n\nAssume a table with date of birth information, stored in a character field. I'll call that field cDOB, for \"character date of birth.\" The new field to hold the date data-type I'll call DOB.\n\nIf the cDOB column has data like 112184 then step one involves arranging it into 11/21/84.\n\nHere are the string functions to do that. Left (cdob, 2) & \"/\" & Mid (cdob, 3, 2) & \"/\" & Mid (cdob, 5, 2)\n\nIf the date information looked like 841121, you'd rearrange the pieces accordingly to get the same result of mm/dd/yy.\n\nStep two is converting this character representation of a date into a date datatype.\n\nIn Access, this means wrapping CVDate() around the entire command above. Since there are already lots of parentheses, I spread out the two parentheses belonging to CVDate() to make things clearer. (In Access SQL, anywhere you can put one space, you can put several, or even a new line.)\n\nCVDate ( Left ( cdob, 2) & \"/\" & Mid ( cdob, 3, 2) & \"/\" & Mid ( cdob, 5, 2) )\n\nPutting this fragment together in an update query for our example table (called Employees) looks like this:\n\nUPDATE employees SET dob = CVDate ( Left ( cdob, 2) & \"/\" & Mid ( cdob, 3, 2) & \"/\" & Mid ( cdob, 5, 2) )\n\nThis works, but know that data isn't perfect. Not all combinations of numbers that may have been typed into a government database to represent a real calendar date actually will. We know, and Access knows, that there is no such date as the 30th of February or the 41st of November. If your update query finds any invalid character dates like this, you'll get this message:\n\nMicrosoft Access can't update all the records in the update query.\n\nMicrosoft Access didn't update field(s) due to a type conversion failure.\n\nClick the Yes button to go ahead with the update. All the character dates that couldn't be converted to a calendar date will be set to empty or Null. Run a query to show all the rows where the date column you just updated is Null.\n\nSELECT * FROM employees WHERE dob is Null",
  "provenance": {
    "extracted_by": "anthropic/claude-sonnet-4-6",
    "extracted_at": "2026-07-05",
    "verified": true
  },
  "similar": [
    {
      "slug": "1996-march-how-to-get-a-date",
      "score": 0.367
    },
    {
      "slug": "2000-april-text-to-date",
      "score": 0.337
    },
    {
      "slug": "1999-januaryfebruary-cant-get-a-date",
      "score": 0.314
    },
    {
      "slug": "1998-july-tech-tip-tell-me-y2k-you-cry",
      "score": 0.308
    },
    {
      "slug": "1998-june-date-handling-in-popular-car-applications",
      "score": 0.265
    }
  ],
  "html_url": "https://dwillis.github.io/uplink/article/1998-february-converting-dates-in-access.html",
  "json_url": "https://dwillis.github.io/uplink/article/1998-february-converting-dates-in-access.json"
}