Skip to content

Commit fa7d1a1

Browse files
Merge pull request #14 from waqasm78/master
Added String Split articles
2 parents d4c1f04 + 9412c4b commit fa7d1a1

File tree

138 files changed

+3873
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+3873
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Convert_ToBoolean
2+
3+
`Convert_ToBoolean` converts the specified string representation of a logical value to its Boolean equivalent.
4+
```csharp
5+
Convert_ToBoolean (
6+
@value NVARCHAR (MAX)
7+
)
8+
RETURNS BIT
9+
```
10+
11+
## Parameters
12+
13+
- **value**: A string that contains the value of either `TrueString` or `FalseString`.
14+
15+
## Returns
16+
17+
`true` if `value` equals `TrueString`, or false if `value` equals `FalseString`.
18+
19+
## Example
20+
21+
```csharp
22+
SELECT SQLNET::Convert_ToBoolean('false')
23+
SELECT SQLNET::Convert_ToBoolean('true')
24+
```
25+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Convert_ToByte
2+
3+
`Convert_ToByte` converts the specified string representation of a number to an equivalent 8-bit unsigned integer.
4+
```csharp
5+
Convert_ToByte (
6+
@value NVARCHAR (MAX)
7+
)
8+
RETURNS TINYINT
9+
```
10+
11+
## Parameters
12+
13+
- **value**: A string that contains the number to convert.
14+
15+
## Returns
16+
17+
An 8-bit unsigned integer that is equivalent to the `value`.
18+
19+
## Example
20+
21+
```csharp
22+
SELECT SQLNET::Convert_ToByte('3')
23+
SELECT SQLNET::Convert_ToByte('136')
24+
```
25+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Convert_ToDateTime
2+
3+
`Convert_ToDateTime` converts the specified string representation of a date and time to an equivalent date and time value.
4+
5+
```csharp
6+
Convert_ToDateTime (
7+
@value NVARCHAR (MAX)
8+
)
9+
RETURNS DATETIME
10+
```
11+
12+
## Parameters
13+
14+
- **value**: The string representation of a date and time.
15+
16+
## Returns
17+
18+
The date and time that is equivalent to the `value`.
19+
20+
## Example
21+
22+
```csharp
23+
SELECT SQLNET::Convert_ToDateTime('2015-12-27')
24+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Convert_ToDecimal
2+
3+
`Convert_ToDecimal` converts the specified string representation of a number to an equivalent decimal number.
4+
5+
```csharp
6+
Convert_ToDecimal (
7+
@value NVARCHAR (MAX)
8+
)
9+
RETURNS NUMERIC (18)
10+
```
11+
12+
## Parameters
13+
14+
- **value**: A string that contains a number to convert.
15+
16+
## Returns
17+
18+
A decimal number that is equivalent to the number in `value`.
19+
20+
## Example
21+
22+
```csharp
23+
SELECT SQLNET::Convert_ToDecimal('2015-12-27')
24+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Convert_ToDouble
2+
3+
`Convert_ToDouble` converts the specified string representation of a number to an equivalent double-precision floating-point number.
4+
5+
```csharp
6+
Convert_ToDouble (
7+
@value NVARCHAR (MAX)
8+
)
9+
RETURNS FLOAT (53)
10+
```
11+
12+
## Parameters
13+
14+
- **value**: A string that contains the number to convert.
15+
16+
## Returns
17+
18+
A double-precision floating-point number that is equivalent to the number in `value`.
19+
20+
## Example
21+
22+
```csharp
23+
SELECT SQLNET::Convert_ToDouble('-1,035.77219')
24+
SELECT SQLNET::Convert_ToDouble('1e-35')
25+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Convert_ToInt16
2+
3+
`Convert_ToInt16` converts the string representation of a number in a specified base to an equivalent 16-bit signed integer.
4+
5+
```csharp
6+
Convert_ToInt16 (
7+
@value NVARCHAR (MAX)
8+
)
9+
RETURNS SMALLINT
10+
```
11+
12+
## Parameters
13+
14+
- **value**: A string that contains the number to convert.
15+
16+
## Returns
17+
18+
A 16-bit signed integer that is equivalent to the number in `value`.
19+
20+
## Example
21+
22+
```csharp
23+
SELECT SQLNET::Convert_ToInt16('251')
24+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Convert_ToInt32
2+
3+
`Convert_ToInt32` converts the specified string representation of a number to an equivalent 32-bit signed integer.
4+
5+
```csharp
6+
Convert_ToInt32 (
7+
@value NVARCHAR (MAX)
8+
)
9+
RETURNS SMALLINT
10+
```
11+
12+
## Parameters
13+
14+
- **value**: A string that contains the number to convert.
15+
16+
## Returns
17+
18+
A 32-bit signed integer that is equivalent to the number in `value`.
19+
20+
## Example
21+
22+
```csharp
23+
SELECT SQLNET::Convert_ToInt32('4285')
24+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Convert_ToInt64
2+
3+
`Convert_ToInt64` converts the specified string representation of a number to an equivalent 64-bit signed integer.
4+
5+
```csharp
6+
Convert_ToInt64 (
7+
@value NVARCHAR (MAX)
8+
)
9+
RETURNS SMALLINT
10+
```
11+
12+
## Parameters
13+
14+
- **value**: A string that contains the number to convert.
15+
16+
## Returns
17+
18+
A 64-bit signed integer that is equivalent to the number in `value`.
19+
20+
## Example
21+
22+
```csharp
23+
SELECT SQLNET::Convert_ToInt64('854')
24+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Convert
2+
3+
Converts a string to another base data type.
4+
5+
| Name | Description | Example |
6+
| :--- | :---------- | :------ |
7+
| [Convert_ToBoolean(value)](/convert-toboolean) | Converts the specified string representation of a logical value to its Boolean equivalent. | [Try it]()|
8+
| [Convert_ToByte(value)](/convert-tobyte) | Converts the specified string representation of a number to an equivalent 8-bit unsigned integer. | [Try it]()|
9+
| [Convert_ToDateTime(value)](/convert-todatetime) | Converts the specified string representation of a date and time to an equivalent date and time value. | [Try it]()|
10+
| [Convert_ToDecimal(value)](/convert-todecimal) | Converts the specified string representation of a date and time to an equivalent decimal value. | [Try it]()|
11+
| [Convert_ToDouble(value)](/convert-todouble) | Converts the specified string representation of a number to an equivalent double-precision floating-point number. | [Try it]()|
12+
| [Convert_ToInt16(value)](/convert-toint16) | Converts the string representation of a number in a specified base to an equivalent 16-bit signed integer. | [Try it]()|
13+
| [Convert_ToInt32(value)](/convert-toint32) | Converts the specified string representation of a number to an equivalent 32-bit signed integer. | [Try it]()|
14+
| [Convert_ToInt64(value)](/convert-toint64) | Converts the specified string representation of a number to an equivalent 64-bit signed integer. | [Try it]()|
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# DateTime_AddDays
2+
3+
`DateTime_AddDays` returns a new DateTime that adds the specified number of days to the value of `currDate`.
4+
5+
```csharp
6+
DateTime_AddDays (
7+
@currDate DATETIME,
8+
@value FLOAT (53))
9+
)
10+
RETURNS DATETIME
11+
```
12+
13+
## Parameters
14+
15+
- **currDate**: The current datetime object.
16+
- **value**: A number of whole and fractional days. The `value` parameter can be negative or positive.
17+
18+
## Returns
19+
20+
A new `DateTime` object whose value is the sum of the date and time represented by `currDate` and the number of days represented by `value`.
21+
22+
## Example
23+
24+
```csharp
25+
SELECT SQLNET::DateTime_AddDays('2017-05-25', 4)
26+
SELECT SQLNET::DateTime_AddDays('2018-12-01', 2.2)
27+
```
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# DateTime_AddMonths
2+
3+
`DateTime_AddMonths` returns a new DateTime that adds the specified number of months to the value of `currDate`.
4+
5+
```csharp
6+
DateTime_AddMonths (
7+
@currDate DATETIME,
8+
@value INT)
9+
)
10+
RETURNS DATETIME
11+
```
12+
13+
## Parameters
14+
15+
- **currDate**: The current datetime object.
16+
- **value**: A number of months. The `value` parameter can be negative or positive.
17+
18+
## Returns
19+
20+
A new `DateTime` object whose value is the sum of the date and time represented by `currDate` and the number of months represented by `value`.
21+
22+
## Example
23+
24+
```csharp
25+
SELECT SQLNET::DateTime_AddMonths('2017-05-25', 4)
26+
SELECT SQLNET::DateTime_AddMonths('2018-12-01', -3)
27+
```
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# DateTime_AddYears
2+
3+
`DateTime_AddYears` returns a new DateTime that adds the specified number of years to the value of `currDate`.
4+
5+
```csharp
6+
DateTime_AddYears (
7+
@currDate DATETIME,
8+
@value INT)
9+
)
10+
RETURNS DATETIME
11+
```
12+
13+
## Parameters
14+
15+
- **currDate**: The current datetime object.
16+
- **value**: A number of years. The `value` parameter can be negative or positive.
17+
18+
## Returns
19+
20+
A new `DateTime` object whose value is the sum of the date and time represented by `currDate` and the number of years represented by `value`.
21+
22+
## Example
23+
24+
```csharp
25+
SELECT SQLNET::DateTime_AddYears('2017-05-25', 4)
26+
SELECT SQLNET::DateTime_AddYears('2018-12-01', -3)
27+
```
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# DateTime_Age
2+
3+
`DateTime_Age` returns an age in number of years between `startDate` and `endDate`.
4+
5+
```csharp
6+
DateTime_Age (
7+
@startDate DATETIME,
8+
@endDate DATETIME
9+
)
10+
RETURNS FLOAT (53)
11+
```
12+
13+
## Parameters
14+
15+
- **startDate**: The start datetime object.
16+
- **endDate**: The end datetime object.
17+
18+
## Returns
19+
20+
An age in number of years between `startDate` and `endDate`.
21+
22+
## Example
23+
24+
```csharp
25+
SELECT SQLNET::DateTime_Age('2002-05-25', '2018-12-01')
26+
```
27+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# DateTime_DayOfWeek
2+
3+
`DateTime_DayOfWeek` returns the day of the week represented by `currDate`.
4+
5+
```csharp
6+
DateTime_DayOfWeek (
7+
@currDate DATETIME,
8+
)
9+
RETURNS NVARCHAR (MAX)
10+
```
11+
12+
## Parameters
13+
14+
- **currDate**: The current datetime object.
15+
16+
## Returns
17+
18+
The day of the week represented by `currDate`.
19+
20+
## Example
21+
22+
```csharp
23+
SELECT SQLNET::DateTime_DayOfWeek('2018-12-01')
24+
```
25+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# DateTime_DayOfYear
2+
3+
`DateTime_DayOfYear` returns day of the year, expressed as a value between 1 and 366 represented by `currDate`.
4+
5+
```csharp
6+
DateTime_DayOfYear (
7+
@currDate DATETIME,
8+
)
9+
RETURNS INT
10+
```
11+
12+
## Parameters
13+
14+
- **currDate**: The current datetime object.
15+
16+
## Returns
17+
18+
The day of the year, expressed as a value between 1 and 366.
19+
20+
## Example
21+
22+
```csharp
23+
SELECT SQLNET::DateTime_DayOfYear('2018-12-01')
24+
SELECT SQLNET::DateTime_DayOfYear('2016-12-31')
25+
```
26+

0 commit comments

Comments
 (0)