简体   繁体   中英

hh:mm:ss to hh:mm sql

I saw similar questions, but somehow it doesn't work for me.

I have cast(arrival as time) which gives me time in hh:mm:ss format, and I want only hh:mm. I tried CONVERT(VARCHAR(5),cast(arrival as time), 108) and I get error.

arrival is datetime

You tried both but once try,

DATE_FORMAT(`date`, '%H:%i')

Let me know, if its working

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM