{
  "id": "1997-march-tech-tip",
  "slug": "1997-march-tech-tip",
  "url": "https://dwillis.github.io/uplink/article/1997-march-tech-tip.html",
  "year": 1997,
  "month": "March",
  "monthNum": 3,
  "headline": "Tech Tip",
  "kicker": "What day is it?",
  "author_name": "Richard Mullins",
  "author_title": "Computer-Assisted Reporting Instructor",
  "affiliation": "NICAR/Missouri School of Journalism",
  "summary": "This tech tip explains how to use database functions in Access and FoxPro to determine the day of the week from date fields, allowing journalists to analyze patterns like which weekdays have the most arrests or traffic accidents without manually checking calendars.",
  "keywords": [
    "database",
    "functions",
    "dates"
  ],
  "topics": [
    "Technology",
    "Data & Databases"
  ],
  "technologies": [
    "Access",
    "FoxPro",
    "SQL"
  ],
  "full_text": "Tech Tip What day is it?\n\nBy Richard Mullins\nNICAR/Missouri School of Journalism\n\nIf you wanted to find out what day of the week you were born, you could find a calendar for that year and look it up.\n\nBut if you wanted to find out which weekday had the most arrests or traffic accidents, the calendar lookup strategy would be too time-consuming for 50 records, let alone 150,000.\n\nAccess and FoxPro have functions that look at a date and determine the day of the week for that date. I'll explain both and show examples, starting with the FoxPro functions. For illustration, I'll assume a table called Arrests, with date-type field called BookDate.\n\nYou can see how this works with a query like this:\n\nSELECT bookdate, dow (bookdate) ;\nFROM arrests\n\nThe dow() function returns the day-of-the-week as number, with Sunday being 1. If you want the name of the weekday, use cdow(). Here's how to remember the function names: DOW stands for DayOfWeek and CDOW stands for CharacterDayOfWeek.\n\nSELECT bookdate, dow (bookdate), cdow (bookdate) ;\nFROM arrests\n\nSince you can always retrieve this day-of-week information with the function, you don't need to store the weekday in a new field in order to use it for a query. To find the arrest counts by weekday, in descending order, you would write this group-by query:\n\nSELECT cdow (bookdate) count (bookdate)\nFROM arrests ;\nGROUP BY 1 ;\nORDER BY 2 DESC\n\nIn Access, you can get this same information with the format() function. The help file on this function is quite long, since the function is used for more than just dates.\n\nHere is a general tip for help files: If you think that the help file on a particular topic is too confusing or too long, then look through the examples for the stuff that seems to fit what you want to do. Paste the example into your query and try it out.\n\nHere is the general syntax for the Access format function as it applies to dates. You specify two parameters, or instructions. These go inside the parentheses after the function name and are separated by commas.\n\nThe first parameter is some date expression, like a literal date or a column containing a date. The second is format specifier, which is a quoted string of characters specifying how you want the day of the week to be expressed. Here is the syntax:\n\nFormat DateExpression, FormatTemplate\n\nYou have three choices for FormatTemplate:\n\nW day of week as a number\nddd as abbreviation (Sun-Sat)\ndddd as full name (Sunday-Saturday)\n\nApplying this to the example table, here are the queries in Access:\n\nTo get the day of the week as a number:\n\nSELECT bookdate, format (bookdate, \"w\")\nFROM arrests ;\n\nTo get the day of the week as an abbreviation:\n\nSELECT bookdate, format (bookdate, \"ddd\")\nFROM arrests ;\n\nTo get the day of the week as a full name:\n\nSELECT bookdate, format (bookdate, \"dddd\")\nFROM arrests ;\n\nThe Access query to show arrests by weekday, in descending order of the arrest count:\n\nSELECT format (bookdate, \"dddd\"), count (bookdate)\nFROM arrests\nGROUP BY format (bookdate, \"dddd\"),\nORDER BY count (bookdate) DESC ;\n\nCan't turn your text file into a table? This question and more were answered in Tech Tip columns in 1996. The bound edition of 1996 Uplinks is now available for $20 plus shipping. To order, call Wendy Charron at (573) 882-0684.\n\nRichard Mullins can be reached at (573) 882-2127, or send e-mail to richard@nicar.org",
  "provenance": {
    "extracted_by": "anthropic/claude-sonnet-4-6",
    "extracted_at": "2026-07-05",
    "verified": true
  },
  "similar": [
    {
      "slug": "1992-november-unraveling-those-mysterious-string-functions",
      "score": 0.3
    },
    {
      "slug": "1997-august-car-tech-tip",
      "score": 0.298
    },
    {
      "slug": "1997-june-whats-your-function",
      "score": 0.259
    },
    {
      "slug": "1998-february-converting-dates-in-access",
      "score": 0.248
    },
    {
      "slug": "1998-july-tech-tip-tell-me-y2k-you-cry",
      "score": 0.244
    }
  ],
  "html_url": "https://dwillis.github.io/uplink/article/1997-march-tech-tip.html",
  "json_url": "https://dwillis.github.io/uplink/article/1997-march-tech-tip.json"
}