You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns an integer representing the day (day of the month) of the specified *date*.
35
+
This function returns an integer that represents the day (day of the month) of the specified *date*.
36
36
37
-
For an overview of all [!INCLUDE[tsql](../../includes/tsql-md.md)] date and time data types and functions, see [Date and Time Data Types and Functions (Transact-SQL)](../../t-sql/functions/date-and-time-data-types-and-functions-transact-sql.md).
37
+
See [Date and Time Data Types and Functions (Transact-SQL)](../../t-sql/functions/date-and-time-data-types-and-functions-transact-sql.md) for an overview of all [!INCLUDE[tsql](../../includes/tsql-md.md)] date and time data types and functions.
38
38
39
39
[Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
40
40
@@ -46,24 +46,33 @@ DAY ( date )
46
46
47
47
## Arguments
48
48
*date*
49
-
Is an expression that can be resolved to a **time**, **date**, **smalldatetime**, **datetime**, **datetime2**, or **datetimeoffset** value. The *date* argument can be an expression, column expression, user-defined variable or string literal.
49
+
An expression that resolves to one of the following data types:
50
+
51
+
+**date**
52
+
+**datetime**
53
+
+**datetimeoffset**
54
+
+**datetime2**
55
+
+**smalldatetime**
56
+
+**time**
57
+
58
+
For *date*, `DAY` will accept a column expression, expression, string literal, or user-defined variable.
50
59
51
60
## Return Type
52
61
**int**
53
62
54
63
## Return Value
55
64
DAY returns the same value as [DATEPART](../../t-sql/functions/datepart-transact-sql.md) (**day**, *date*).
56
65
57
-
If *date* contains only a time part, the return value is 1, the base day.
66
+
If *date* contains only a time part, `DAY` will return 1 - the base day.
58
67
59
68
## Examples
60
-
The following statement returns `30`. This is the number of the day.
69
+
This statement returns `30` - the number of the day itself.
61
70
62
71
```sql
63
72
SELECT DAY('2015-04-30 01:01:01.1234567');
64
73
```
65
74
66
-
The following statement returns `1900, 1, 1`. The argument for *date*is the number `0`. [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] interprets `0` as January 1, 1900.
75
+
This statement returns `1900, 1, 1`. The *date*argument has a number value of`0`. [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] interprets `0` as January 1, 1900.
0 commit comments