Skip to Content
Fuzzy Data Matching with SQL
book

Fuzzy Data Matching with SQL

by Jim Lehmer
October 2023
Intermediate to advanced
282 pages
6h 32m
English
O'Reilly Media, Inc.
Content preview from Fuzzy Data Matching with SQL

Chapter 5. Dates, Dates, Dates

There are three basic problems with dates:

  • They are impossibly hard.

  • They can be represented by an almost infinite number of culture formats.

  • Even taking all that into account, they can be misentered.

In this chapter we’ll discuss all of these problems and various approaches to handling them.

Time Is Relative

Why are dates “impossibly hard”? I used to work on a CRM system that, depending on the user’s locale setting, could display to an end user a birth date a day in the future or past of what the person whose nativity it represented thought was their birthday. Why? Because it didn’t force all birth dates into simply a date-only format like YYYY-MM-DD. After all (thought that system’s designers), you may want to capture what time your customer (your patient’s new child?) was born. So the birth date field was of course a SQL DATETIME datatype. Obviously. Makes sense.

Except that the user interface to that system had no way of specifying the time component, or for that matter the time zone, of the birth date in mention, and so would simply record whatever was the current time and time zone for the user entering the data (and also for any system pushing data into it). Hence, if your birth date was April 1, 1990, and the person entering that into the system was on the West Coast of the United States at 4:45 p.m., then your birth time would be entered in that timestamp as 4:45PM PST (or PDT depending on the time of year, oh joy). And guess what? ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

SQL for Data Analysis

SQL for Data Analysis

Cathy Tanimura

Publisher Resources

ISBN: 9781098152260Errata Page