From the course: CompTIA Data+ (DA0-002) Cert Prep

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Working with dates

Working with dates

- [Instructor] Working with dates can be among the trickiest operations in many analytics environments. We might be tempted to simply place dates in a character string data type and then just treat them like text, but this poses some challenges. If a date is simply written as text, it becomes very difficult to work with it in any other way. For example, if we have a text string containing a date like July 1st, 2022, and we want to find out what the next day is, we can't simply add one to a text string. That's not a valid option. You'd have all sorts of strange possibilities here, depending upon the environment you're in. For example, you might wind up treating one as a string and then concatenating the two strings to get the string July 1st, 20221, which is meaningless. However, if we use the special data types that are created to support dates, they give us a lot more flexibility. Now we can take July 1st, 2022 and add one to get the expected result July 2nd, 2022. When we use date…

Contents