You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
D6JIEFENGMAIL/doc/sql/debug_sqlserver字符串转日期.txt

38 lines
790 B
Plaintext

11 months ago
/****** Script for SelectTopNRows command from SSMS ******/
update [dongsheng2017ceshi].[dbo].[t_op_seae_ftpfile_bc]
set [t_op_seae_ftpfile_bc].lastmodi_date= v2.mddate
from
(
select
dateadd(hour,8,
CONVERT(DATETIME,substring (mddate,1,4)+'-'+SUBSTRING(mddate,5,2)+'-'+SUBSTRING(mddate,7,2)
+ ' ' +SUBSTRING(mddate,9,2) + ':'+ SUBSTRING(mddate,11,2)+ ':'+ SUBSTRING(mddate,13,2) )
) as mddate ,ID as id
from
(
SELECT
SUBSTRING([ftp_filename],len([ftp_filename])-17,14 ) as mddate,
[ID]
FROM [dongsheng2017ceshi].[dbo].[t_op_seae_ftpfile_bc] t where t.remark=''
) v
)
v2 where t_op_seae_ftpfile_bc .id=v2.id
select dateadd(hour,2,GETDATE()),getdate()
MAEU-597849166-574056638-ORIGINAL-20171030101803.pdf
SEAWAY
ADVANCE
APPROVED
ORIGINAL