How to retrieve the Date part out of a Datetime result column in SQLite?

前端 未结 4 1978
被撕碎了的回忆
被撕碎了的回忆 2021-01-03 08:06

I have a column of datetime type from which I would like to retrieve only the date. Is there anyway to do this?

Previously it was an epoch value where I convert it t

4条回答
  •  温柔的废话
    2021-01-03 08:33

    Try looking up usage of the "datepart" function in SQL.

    Something like this should work:

    SELECT datewithouttime as datepart(dd,datefield)+'/'+datepart(mm,datefield)+"/"+datepart(yyyy,datefield) FROM tableName
    

提交回复
热议问题