469,930 Members | 1,749 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,930 developers. It's quick & easy.

Convert nvarchar to smalldatetime

How do I convert an nvarchar field to smalldatetime format?

My nvarcharfield (saledatetext) is in the format YYYY-MM-DD.

I want to convert is to smalldatetime (field: saledate)

Thanks for the help

*** Sent via Developersdex http://www.developersdex.com ***
Jul 22 '05 #1
1 5402
CONVERT(DATETIME, saledatetext, 120)

Note that the third parameter (which indicates date format) is not strictly
necessary when using yyyy-mm-dd, but it is when using formats that can be
ambiguous.
-Mark

"Joey Martin" <jo**@infosmiths.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
How do I convert an nvarchar field to smalldatetime format?

My nvarcharfield (saledatetext) is in the format YYYY-MM-DD.

I want to convert is to smalldatetime (field: saledate)

Thanks for the help

*** Sent via Developersdex http://www.developersdex.com ***

Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by Lauren Quantrell | last post: by
2 posts views Thread by Joey Martin | last post: by
2 posts views Thread by Jelena via SQLMonster.com | last post: by
reply views Thread by Wes Peters | last post: by
1 post views Thread by Wes Peters | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.