Reputation: 1569
I am trying to insert date in table in format DD.MM.YYYY, How do I do it?
Here is the code what I am trying, but there are some errors in it:
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
Edit
Answer
Solved it by myself. I am inserting in DAT column with now(), but I am formatting my view column like I needed.
Upvotes: 2
Views: 329
Reputation: 19189
edit:
Mysql has functions to change format. I found:
str_to_date('".$mydate."', '%d-%c-%Y')
Upvotes: 0