MS-SQL 날짜 형식 변환

CONVERT로 필요한 형식으로 변환
varchar는 varchar(10)과 같이 문자열 길이를 지정해야 한다.
실행예
UPDATE tblDL set DateTime=CONVERT(VARCHAR,GETDATE(),25) WHERE DateTime IS NULL
select CONVERT(varchar,getdate(),01) DATEFORM01   => 11/16/08
select CONVERT(varchar,getdate(),02) DATEFORM02   => 08.11.16
select CONVERT(varchar,getdate(),03) DATEFORM03   => 16/11/08
select CONVERT(varchar,getdate(),04) DATEFORM04   => 16.11.08
select CONVERT(varchar,getdate(),05) DATEFORM05   => 16-11-08
select CONVERT(varchar,getdate(),06) DATEFORM06   => 16 11 08
select CONVERT(varchar,getdate(),07) DATEFORM07   => 16 16,08
select CONVERT(varchar,getdate(),08) DATEFORM08   => 14:00:00
select CONVERT(varchar,getdate(),09) DATEFORM09   => 11 16 2008  2:00:00:000PM
select CONVERT(varchar,getdate(),10) DATEFORM10   => 11-16-08
select CONVERT(varchar,getdate(),11) DATEFORM11   => 08/11/16
select CONVERT(varchar,getdate(),12) DATEFORM12   => 081116
select CONVERT(varchar,getdate(),13) DATEFORM13   => 16 11 2008 14:00:00:000
select CONVERT(varchar,getdate(),14) DATEFORM14   => 14:00:00:000
select CONVERT(varchar,getdate(),20) DATEFORM20   => 2008-11-16 14:00:00
select CONVERT(varchar,getdate(),21) DATEFORM21   => 2008-11-16 14:00:00.000
select CONVERT(varchar,getdate(),22) DATEFORM22   => 11/16/08 2:00:00 PM
select CONVERT(varchar,getdate(),23) DATEFORM23   => 2008-11-16
select CONVERT(varchar,getdate(),24) DATEFORM24   => 14:00:00
select CONVERT(varchar,getdate(),25) DATEFORM25   => 2008-11-16 14:00:00.000

“MS-SQL 날짜 형식 변환”의 44개의 댓글

  1. I simply want to tell you that I’m newbie to blogging and honestly enjoyed your web blog. Probably I’m going to bookmark your website . You amazingly come with superb article content. Thanks a bunch for revealing your blog site.

  2. Great post. I was checking continuously this blog and I am impressed! Extremely useful info specifically the last part 🙂 I care for such info a lot. I was seeking this particular information for a long time. Thank you and good luck.

  3. What i don’t realize is actually how you are not actually much more well-liked than you may be right now. You’re very intelligent. You realize thus considerably relating to this subject, produced me personally consider it from so many varied angles. Its like men and women aren’t fascinated unless it is one thing to accomplish with Lady gaga! Your own stuffs excellent. Always maintain it up!

  4. Hi, i think that i saw you visited my web site so i came to “return the favor”.I’m trying to find things to improve my site!I suppose its ok to use some of your ideas!!

  5. I just want to mention I’m new to blogging and site-building and absolutely liked you’re web page. Probably I’m want to bookmark your blog post . You surely come with amazing stories. Kudos for sharing your website page.

  6. I loved as much as you will obtain performed proper here. The caricature is tasteful, your authored subject matter stylish. nevertheless, you command get got an nervousness over that you want be handing over the following. ill no doubt come further previously once more as exactly the same just about very continuously inside of case you protect this increase.

  7. Also I believe that mesothelioma cancer is a exceptional form of melanoma that is generally found in people previously subjected to asbestos. Cancerous tissue form while in the mesothelium, which is a defensive lining that covers almost all of the body’s bodily organs. These cells typically form while in the lining of your lungs, abdomen, or the sac that encircles the heart. Thanks for discussing your ideas.

  8. This is the perfect blog for anybody who hhopes to find out about this topic.

    You definitely put a brand new spin on a topic which has been discussed for decades.Wonderful stuff, just
    excellent!

  9. This is really exciting, You’re an especially skilled writer. I’ve enrolled with your feed plus look ahead to enjoying the excellent write-ups. Additionally, I’ve shared your web sites inside our myspace.

  10. *Can I just say what a relief to find someone who actually knows what theyre talking about on the internet. You definitely know how to bring an issue to light and make it important. More people need to read this and understand this side of the story. I cant believe youre not more popular because you definitely have the gift.

  11. Nice post. I discover some thing very complicated on diverse blogs everyday. It will always be stimulating to study content from other writers and rehearse something there. I’d want to use some while using content on my blog regardless of whether you don’t mind. Natually I’ll give you a link in your internet blog. Thanks for sharing.

  12. I simply want to say I’m new to weblog and truly loved this website. Most likely I’m want to bookmark your site . You really come with very good writings. With thanks for sharing with us your web page.

  13. Keep in touch whilst functioning from your own home office with out all of the hassle of purchasing or procurment costly office equipment. Debtors are allowed to apply with their a bad credit score background whenever.

  14. I was very pleased to discover this page. I want to to thank you for your time due to this wonderful read!! I definitely loved every little bit of it and i also have you saved to fav to see new things in your web site.

  15. Hello! Quick question that’s totally off topic. Do you know how to make your site mobile friendly? My blog looks weird when browsing from my iphone. I’m trying to find a template or plugin that might be able to fix this problem. If you have any suggestions, please share. Cheers!

  16. I am now not positive where you are getting your info, however great topic. I must spend a while studying more or working out more. Thank you for fantastic information I used to be looking for this info for my mission.

댓글 남기기