SQL converts datetime to a string and truncates the string select sr_child as 'child name', sr_parents as 'parent name', ss_updatetime as 'allocation time', left (ss_updatetime, CHARINDEX ('', ss_updatetime)-1), SUBSTRING (CONVERT (CHAR (19), ss_updatetime, 120),) as 'converted format and truncated time' from dbo. tb_sell_resources, dbo. tb_sell_selldetails where sr_id = ss_rsid and ss_qdstate <> 1 order by ss_updatetime SQL string truncation function: SUBSTRING (name, start, end) name: string format field name start: specify the start position (start value is 1) end: capture the end position of the string. in SQL, CONVERT the Datetime format to the string format: 2000-01-01 01:01:01 (Datetime) CONVERT (CHAR (19), CURRENT_TIMESTAMP, 120) CURRENT_TIMESTAMP: the current time (you can enter the field name in Datetime format, for example, ss_updatetime). Other parameters (CHAR (19), 120, etc.) do not need to be modified) changed to 01:01:01 (string format)