小崔说SAP技术博客 - 年月日
type: channel
link: https://sapxiaocui.top/index.php/tag/%E5%B9%B4%E6%9C%88%E6%97%A5/
items: SAP B1 标准字段获取完整年月日时分秒

SAP B1 标准字段获取完整年月日时分秒
type: item
date: 2024-07-11T07:58:00+00:00
description: 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