Convert (varchar (10), field name, conversion format)
Convert (nvarchar (10), count_time, 121)
Convert is a date conversion function, generally in the time type (datetime, smalldatetime) and string type (nchar, nvarchar, Char, varchar)
The three parameters of the function used only during mutual conversion. The first parameter is the size of the converted function, the second parameter is the field or function of the date to be converted, and the second parameter is the conversion format.
The details are as follows:
0 | 0 or 100 | mon dd yyyy hh: miam (or pm)
1 | 101 | mm/DD/yy
2 | 102 | YY-mm-dd
3 | 103 | dd/mm/yy
4 | 104 | DD-mm-yy
5 | 105 | DD-mm-yy
6 | 106 | dd mon YY
7 | 107 | mon DD, YY
Eight | 108 | hh: mm: SS
9 | 9 or 109 | mon dd yyyy hh: MI: SS: mmmmam (or pm)
10 | 110 | mm-dd-yy
11 | 111 | YY/MM/dd
12 | 112 | yymmdd
11 | 13 or 113 | dd mon yyyy hh: MI: SS: Mmm (in 24-hour format)
14 | 114 | hh: MI: SS: Mmm (in 24-hour format)
15 | 20 or 120 | yyyy-mm-dd hh: MI: SS (in 24-hour format)
16 | 21 or 121 | yyyy-mm-dd hh: MI: SS: Mmm (in 24-hour format)
Time Comparison:
Cast ( ' 1900 ' + Time1 As Datetime ) > Cast ( ' 1900-01-01 ' + @ Begin As Datetime )