From the course: Intermediate SQL: Data Reporting and Analysis

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Use date functions

Use date functions

- [Instructor] Dates are tricky, there's no getting around it. Part of the problem is that SQL date handling differs widely between versions of SQL. I can't give you a definitive guide because many settings such as currency or thousand separators are set at the database level with your local settings. This means two students with the same database and software version could handle dates differently. Let's learn some tricks to reduce this pain. We're going to look at some common issues with dates, different ways of storing date time information, transforming the date format and time zones. It's important for you to understand that date type information can generally be stored in three different data types behind the scenes. It can be stored as a date, date time or a time stamp. Time stamps are not generally human readable but they take up less space in the database and are indexed faster, so databases love them. The actual…

Contents