TIP: create SQL server datetime using international date format (ISO 8061)
SELECT
CAST(
CAST(datepart(year, getdate()) AS varchar) + '-' +
RIGHT('0' + CAST(datepart(month, getdate()) AS varchar), 2) + '-' +
RIGHT('0' + CAST(10 AS varchar), 2) +
'T00:00:00'
AS datetime)
Note that SQL Server 2005 does *NOT* accept all ISO 8061 date/time formats. This one works well, and the advantage of using an international date/time format is that the date string is not ambiguous.
The above SQL creates a string consisting of at least 2 digits for day and month, and ends up looking like this for example: '2009-02-10T00:00:00'
SQL accepts that format and can CAST it to datetime.

3 Comments:
This comment has been removed by a blog administrator.
By
伊凡姐姐, at 9:49 PM
酒店打工
酒店兼職
台北酒店
打工兼差
酒店工作
酒店經紀
禮服店
酒店兼差
酒店上班
酒店PT
酒店
By
伊凡姐姐, at 9:49 PM
台灣女藝人 -
洪爺色情小說 -
台灣女藝人拍 3 級片 -
洪爺影城-影片中心 -
小說頻道 -
成人視訊 -
台灣女藝人 a -
成人小說 -
性感照片 -
台灣女藝人 m -
熱門色情小說 -
色情片 -
網路愛情小說 -
成人限制文學情色小說 -
台灣女藝人 s -
bb 台灣女藝人 -
線上小說 -
免費情色小說 -
性愛小說 -
網路愛情小說故事 -
性經驗黃色小說 -
台灣女藝人 h -
性愛聊天室 -
色妹妹貼圖片區 -
性愛電影 -
time 雜誌封面的台灣女藝人 -
情色性愛貼圖 -
性愛自拍 -
性愛貼圖 -
性愛姿勢 -
性愛圖片 -
嘟嘟情色成人網 -
台灣18情色成人網 -
網路電視下載 -
情色成人 -
By
wsxwhx667, at 3:26 AM
Post a Comment
<< Home