Concat (a.R ADU9G, a.R ADT9G) as a summons issued time
The from X
Get the result:
Summons issued time
20200523032421
How to convert types? 20/05/23 03:24
CodePudding user response:
Declare @ Dt varchar (50), @ AA Datetime
The Set @ Dt='20200523032421'
Set @ AA=the SUBSTRING (@ Dt, 1, 4) + '-' + SUBSTRING (@ Dt, 5, 2) + '-' + SUBSTRING (@ Dt, 7, 2) + "+ SUBSTRING (@ Dt, 9, 2) +" : "+ SUBSTRING (@ Dt, 10, 2) +" : "+ SUBSTRING (@ Dt, 12, 2)
Select @ AA