delphi:从数据库中查出来的值能定义格式吗
来源:百度知道 编辑:UC知道 时间:2024/09/28 10:57:36
这个是SQL SERVER里边测试得到的。
你看看。
date:类型tdatetime;值:'2008/01/21'
select convert(nvarchar,date,1) from table
返回格式:01/21/08
select convert(nvarchar,date,2) from table
返回格式:08.01.21
select convert(nvarchar,date,3) from table
返回格式:21/01/08
select convert(nvarchar,date,4) from table
返回格式:21.01.08
select convert(nvarchar,date,5) from table
返回格式:21-01-08
select convert(nvarchar,date,6) from table
返回格式:21 01 08
select convert(nvarchar,date,7) from table
返回格式:01 21, 08
select convert(nvarchar,date,8) from table
返回格式:00:00:00
select convert(nvarchar,date,9) from table
返回格式:01 21 2008 12:00:00:000AM
select convert(nvarchar,date,10) from table
返回格式:01-21-08
select convert(nvarchar,date,11) from table
返回格式:08/01/21
select convert(nvarchar,date,12) from table
返回格式:08