2024-07-11T08:08:07.png

SQL版本:

示例:

SELECT DBO.IPS_FC_ToTime(T0.UpdateDate,T0.UpdateTS)

FROM OCRD T0

函数:

CREATE FUNCTION [dbo].[IPS_FC_ToTime]

(

@DocDate DATETIME,

@DocTime INTEGER

)

RETURNS NVARCHAR(20)

AS

BEGIN

DECLARE @DateTime NVARCHAR(20)

SELECT @DateTime=CONVERT(VARCHAR,@DocDate,23)+' '+LEFT(RIGHT('000000'+CONVERT(VARCHAR,@DocTime),6),2)+':'+LEFT(RIGHT('000000'+CONVERT(VARCHAR,@DocTime),4),2)+':'+RIGHT('000000'+CONVERT(VARCHAR,@DocTime),2)

RETURN @DateTime

END


HANA版本:

示例:

SELECT CAST(T0."UpdateDate" AS NVARCHAR(10))||' '||TO_TIME(LPAD(T0."UpdateTS",6,'0'),'HHMISS') AS "UpdateDate"
FROM "ORDR" T0

已有 4 条评论

  1. 博主真是太厉害了!!!

  2. 想想你的文章写的特别好

  3. 想想你的文章写的特别好https://www.jiwenlaw.com/

发表评论