O'Reilly logo

SQL Server 2012 T-SQL Recipes: A Problem-Solution Approach by Jonathan Gennick, Wayne Sheffield, Andy Roberts, David Dye, Jason Brimhall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 10

image

Working with Dates and Times

by Wayne Sheffield

SQL Server has several different date and time data types, with varying levels of range and precision (and a corresponding varying level of storage requirement space). SQL Server also has numerous functions to retrieve, modify, and validate the data from these data types in various formats. This chapter focuses on these functions. Table 10-1 shows the various date/time data types.

Table 10-1. SQL Server Date/Time Data Types

image

10-1. Returning the Current Date and Time

Problem

You need ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required