close
Blogtrottr
Changes are afoot at Blogtrottr!
By popular request, we're bringing in paid plans with some cool new features (and more on the way). You can read all about it in our blog post.
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 已解決
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 已解決
知識問題|SQL 西曆轉成中歷 ??
Jul 3rd 2013, 02:48

印象中SQL 本身沒有轉民國 時間的函式必須自己自訂

SELECT CONVERT(VARCHAR(3),CONVERT(VARCHAR(4),GETDATE(),20) - 1911) + '/' +
SUBSTRING(CONVERT(VARCHAR(10),GETDATE(),20),6,2) + '/' +
SUBSTRING(CONVERT(VARCHAR(10),GETDATE(),20),9,2) From TableName

給你參考看看
GETDATE() 取目前系統時間
SUBSTRING()擷取自串

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 newhong 的頭像
    newhong

    2016韓國代購網 , 韓國代購化妝品 , 韓國代購批發 , 韓國代購教學---韓國代購/追加/寄貨

    newhong 發表在 痞客邦 留言(0) 人氣()