DECLARE @a FLOAT
SET @a=320
SELECT LEFT('0'+CAST(@a AS VARCHAR),2)+''''+RIGHT(CAST(@a AS VARCHAR),2)+''''''
/*
-------
03'20''
*/
------解决方案--------------------
本帖最后由 DBA_Huangzj 于 2014-03-17 13:01:21 编辑
DECLARE @a FLOAT
SET @a=320
SELECT CASE WHEN LEN(@a)%2<>0 then LEFT('0'+CAST(@a AS VARCHAR),2) ELSE LEFT(CAST(@a AS VARCHAR),2) END +''''+RIGHT(CAST(@a AS VARCHAR),2)+'"'
/*
------
03'20"
*/ ------解决方案-------------------- case when then