2
我想以DD.MM.YYYY格式插入日期,我该怎么做?
这里是我想要的代码,但也有它的一些错误:
在mysql中插入格式日期
insert into nol_art_izm([ART_ID], [DAT])
select distinct
a.ID, DATE_FORMAT({fn now()},'%d.%c.%Y')
from
openxml(@hDoc, '/art_komp/nol_art') with #artTMPL xd
join nol_art a on xd.cd = a.cd
编辑
回答
由我自己解决它。我正在使用now()插入到DAT列中,但是我正在根据需要格式化我的视图列。
什么是错误讯息? – cctan 2012-03-26 07:40:27
@cctan Msg 195,Level 15,State 10,Procedure INSERT_UPDATE_ART_KOMP_XML,Line 507 'DATE_FORMAT'不是公认的内置函数名称。 – Brezhnews 2012-03-26 07:41:26
这很奇怪。什么是你的mysql版本? – oyatek 2012-03-26 07:46:55